wget 不会终止

wget does not terminate

我的代码有以下问题:

下载完成后脚本不会终止。看来要等更多的url了。


我的代码:

#!/bin/bash

cd ""
test=$(wget -qO- "" | 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 包含 URL,则不需要使用 -i,只需在命令行中列出 URL:

wget -nd -N -q --trust-server-names --content-disposition $test