script for easier transmission list output

Linux for blind general discussion blinux-list at redhat.com
Sun May 15 10:43:51 UTC 2022


I have a little script here that prints out the results of
transmission-remote -l
in a slightly easier format to read. The script looks like this:
transmission-remote localhost:9091 -l | awk -F ' +' 'NR>1 && $1 != "Sum:"{name="";for (i=11; i<NF; i++) { name = name $i " "}; printf "%d: %s - %s - %s - %s\n", $2, name, $4, $3, $9}'
The problem is that depending on spacing some of the names don't print or are truncated. I don't know enough about awk and its friends to reliably fix it. Can any of you help?



More information about the Blinux-list mailing list