On 11/07/2011 12:22 PM, Graham Lawrence wrote:
Date: Sun, 06 Nov 2011 20:15:54 -0600
From: Ron Johnson<address@hidden>
pan --no-gui -o /home/g/Films --nzb "${nzb[1]}" 2>/home/g/pan.debug
Slight topic change: are you trying to d/l from a list of nzb files?
Yes and no. I download nzbs manually into a directory, at odd
intervals. In the script I download from just one nzb per run, and
find it most convenient to ls those .nzbs into an array, rm the first
one in the array (because its the file I downloaded last time) and
then download the second element in the array with Pan.
That sounds like a weird use of arrays.
Here's another way to do it...
tmpfile=$(mktemp -u)
NZB=$(head -n1 $NZB_LIST)
pan --no-gui -o /home/g/Films --nzb "$NZB"
tmpfile=$(mktemp -u)
sed '1d' $NZB_LIST > $tmpfile
mv $tmpfile $NZB_LIST
You could also implement it in a loop:
cd /home/g/Films
tmpfile=$(mktemp -u)
QUEUE=~/my_list_of_NZBs.txt
while [ -s $QUEUE ]; do
NZB=$(head -n1 $QUEUE)
pan --no-gui -o . --nzb "$NZB"
sed '1d' $QUEUE > $tmpfile
mv $tmpfile $QUEUE
done