系统:
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’
可以请教该怎么改善吗?感谢