cj13579
October 26th, 2011, 07:36 PM
HI all,
I'm getting really frustrated with this so I was wondering whether someone can help me out? I am am trying to remove the first and last line of the following output:
ID Done Have ETA Up Down Ratio Status Name
3 1% 10.1 MB Unknown 0.0 0.0 0.57 Stopped Horrible Bosses {2011} DVDRIP. Jaybob
Sum: 10.1 MB 0.0 0.0
The output is from transmission-remote. I am trying to dump this all into a variable in a script and it isn't going particularly well. I am trying to use sed but cannot get the command to work. This is what I have so far:
TORRENTLIST=$(transmission-remote --auth user:password --list | sed -e '1d;$d;s/^ *//' | cut –only-delimited –delimiter= ” ” –fields=1)
This is supposed to be dynamic so there could be 1 or 100 things in this list. The next step of my script feeds into a loop doing different stuff basded on their status and Completeness (if you wanted to know - lol).
My failing is that I copied this sed command from somewhere and I can't remember where. I have googled my life away trying to understand sed but I'm just there yet.
Many thanks in advance for any advice!
Thanks
Chris
I'm getting really frustrated with this so I was wondering whether someone can help me out? I am am trying to remove the first and last line of the following output:
ID Done Have ETA Up Down Ratio Status Name
3 1% 10.1 MB Unknown 0.0 0.0 0.57 Stopped Horrible Bosses {2011} DVDRIP. Jaybob
Sum: 10.1 MB 0.0 0.0
The output is from transmission-remote. I am trying to dump this all into a variable in a script and it isn't going particularly well. I am trying to use sed but cannot get the command to work. This is what I have so far:
TORRENTLIST=$(transmission-remote --auth user:password --list | sed -e '1d;$d;s/^ *//' | cut –only-delimited –delimiter= ” ” –fields=1)
This is supposed to be dynamic so there could be 1 or 100 things in this list. The next step of my script feeds into a loop doing different stuff basded on their status and Completeness (if you wanted to know - lol).
My failing is that I copied this sed command from somewhere and I can't remember where. I have googled my life away trying to understand sed but I'm just there yet.
Many thanks in advance for any advice!
Thanks
Chris