【问题标题】:Inserting delays using curl for url unshortening使用 curl 插入延迟以缩短 url
【发布时间】:2015-12-25 10:12:43
【问题描述】:

我正在使用以下脚本来缩短文件中的网址:shortened_urls.txt

cat shorted_urls.txt | xargs -n 1 卷曲 -x 23.100.73.22 同门:PassSworD@myprivateproxy.net:15213 -Ls -I -o /dev/null -w %{url_effective}'\n' > unshortened.txt & 等待

现在我的文件shortened_urls.txt 包含4000 个网址。如何在每个网址未缩短后插入一些等待,例如 1 秒。

【问题讨论】:

  • 查看 Bash sleep 命令

标签: linux url curl xargs


【解决方案1】:
curl -x 23.100.73.22 samemon:PasSworD@myprivateproxy.net:15213 -Ls -I -o /dev/null -w %{url_effective}'\n' $1 >> unshortened.txt; sleep 1

将此部分发给resolve-url.sh

并调用 cat shorted_urls.txt | xargs -n 1 sh ./resolve-url.sh

【讨论】:

  • 我得到以下信息: curl:未指定 URL! curl:尝试“curl --help”或“curl --manual”以获取更多信息 curl:未指定 URL! curl:尝试“curl --help”或“curl --manual”以获取更多信息 curl:未指定 URL!
  • @ShahanAliMemon 哦,我已经修正了文本,你应该加 $1 让 curl 看到。
猜你喜欢
  • 2014-01-04
  • 2020-10-21
  • 2012-09-15
  • 2011-03-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-20
  • 1970-01-01
相关资源
最近更新 更多