for j in `ls` do if [ -d $j ] then cd $j for i in `awk '{print $2}' file|grep http:` do snarf $i done fi cd ~ftp/pub/computers/3b2/images/unix-c done