我想通过以下方式下载一堆编号的文本文件:
curl https://www.grc.com/sn/sn-{472..807}.txt > sn-{472..807}.txt
Run Code Online (Sandbox Code Playgroud)
但这给了我:
bash: sn-{472..807}.txt: 不明确的重定向
所以我最终做了一个:
for iEpisode in {472..807}; do
curl https://www.grc.com/sn/sn-"$iEpisode.txt" > sn-"$iEpisode.txt";
if [[ $? -eq 1 ]]; then exit; fi;
done
Run Code Online (Sandbox Code Playgroud)
问题是:有没有办法做一个简单 curl
的双支架扩展?
(因为它对我来说看起来并不模棱两可,而且我的 Google-fu 一无所获) :/