【发布时间】:2015-03-30 00:35:19
【问题描述】:
我正在尝试逐行执行远程文件:
curl -sL 'http://remote.com/api/'$1'' | while read NAME
do
$($NAME) &
done
远程文件是这样的:
sleep 10; wget -O/opt/store/11.xml http://remote.com/api/11
sleep 10; wget -O/opt/store/12.xml http://remote.com/api/12
sleep 10; wget -O/opt/store/13.xml http://remote.com/api/13
sleep 10; wget -O/opt/store/14.xml http://remote.com/api/14
我想执行每一行,但我收到如下错误:
Try `sleep --help' for more information.
sleep: invalid option -- 'O'
所以睡眠得到了参数-O...
有什么想法吗?
谢谢!
【问题讨论】:
-
hm 现在我得到:./x.sh: line 3: sleep 10; wget -O/opt/store/12.xml remote.com/api/12: 没有这样的文件或目录
标签: bash while-loop sleep