將Click-Me imgur的圖片下載
#!/bin/bash
cat 'temp.txt' | while read line
do
temp=$(echo $line | sed 's/^M//')
index=$(echo $temp | awk -F "," '{ print $1 }')
content=$(echo $temp | awk -F "," '{ print $2 }')
picture=$(echo $temp | awk -F "," '{ print $3 }')
flag=$(echo $temp | awk -F "," '{ print $4 }')
#如果等於1 就建一個資料夾
if [ ! -d /var/www/html/imgbackup/image/$index ]; then
mkdir ./image/$index
fi
wget -t0 -O ./image/$index/$picture.jpg $content
echo "現在進行到-$index"
done
沒有留言:
張貼留言