helm/bin/transmission-list
Henrik Lissner c4be365696 Global bash/zsh aliases + new programs
+ add common.sh and common aliases
+ add bin/{since,til}
+ add bin/project-root
+ extract btl alias into bin/transmission-list
2015-12-21 01:30:42 -05:00

11 lines
359 B
Bash
Executable file

#!/usr/bin/env zsh
# Pretty print remote transmission torrents. Takes one argument: the server hostname/ip
local results
results=`transmission-remote "$1" -l | \
awk 'NR > 1 { s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print $9 " | " s }' | \
sed '$d' | \
perl -pe 's/\s\[[a-zA-Z0-9]+\]\s/ /g'` && echo "$results" || echo "No torrents!"