系統:
Lubuntu 15.10 BASH
LANG=en_US.UTF-8
我想要寫個能夠自動下載特定檔案的script
於是參考這個網頁:
http://stackoverflow.com/questions/23463991/download-files-using-bash-script-using-wget
設定檔有兩個:
file.txt
termb_0.htm
termb_A.htm
termb_B.htm
termb_C.htm
termb_D.htm
=====================================
url.txt
url = http://www.iicm.org.tw/term/
=====================================
download.sh : 執行下載
#!/bin/sh
url=$(awk -F = '{print $2}' url.txt)
for i in $(cat file.txt);
do
wget "${url}${i}"
done
可是怎麼樣都失敗, url.txt的內容沒有被load到
錯誤訊息是類似:wget: unable to resolve host address ‘1.jpg’
可以請教該怎麼改善嗎?感謝