1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/bin/sh DOWN_DIR=/home/fred/example.com/upload/ while read line #c=1 do #c=`expr $c + 1` #echo -e "$line \n" file1=`echo -e $line| awk -F" " '{ print $1 }'` file2=`echo -e $line| awk -F" " '{ print $2 }'` dir1=$DOWN_DIR`echo $file2| awk -F"/" '{ print $1"/"$2 }'` mkdir -p $dir1 wget $file1 -O $DOWN_DIR${file2}.jpg #if [ $c -lt 3 ];then #exit #fi done < "/home/fred/src/db.txt" |
0 Responses to “Download file use bash script and wget”