【发布时间】:2017-03-22 21:57:17
【问题描述】:
我的代码有以下问题:
下载完成后,脚本不会终止。它似乎在等待更多的网址。
我的代码:
#!/bin/bash
cd "$1"
test=$(wget -qO- "$3" | grep --line-buffered "tarball_url" | cut -d '"' -f4)
echo test:
echo $test
echo ==============
wget -nd -N -q --trust-server-names --content-disposition -i- ${test}
$test 的示例:
https://api.github.com/repos/matrixssl/matrixssl/tarball/3-9-1-open https://api.github.com/repos/matrixssl/matrixssl/tarball/3-9-0-open
【问题讨论】:
-
-i-表示从标准输入中读取 URL 列表。因此,它正在等待您输入 URL。 -
是的,正如我写的那样有效,但我该如何终止它?
$test包含网址。