while [ -s $1 ] do file=`cat $1 | head -n 1` wget --http-user=USERNAME --http-password=PASSWORD $file sed 1d $1 > tmp.txt mv tmp.txt $1 done