【问题标题】:How do I interactively pass arguments to cURL from the shell?如何从 shell 以交互方式将参数传递给 cURL?
【发布时间】:2013-01-01 14:22:54
【问题描述】:

我想创建一个别名来使用 cURL 获取文件,提示输入:

  • 网址
  • 输出路径
  • 代理的用户名和密码

我如何能够以交互方式而不是对所有内容进行硬编码?

【问题讨论】:

    标签: shell curl arguments interactive hardcode


    【解决方案1】:

    以下按预期工作:

    alias proxyget='read userid?"Userid: "; read passwd?"Password: "; read url?"URL: "; read local?"Local: "; curl -x 1.2.3.4:8080 -U $userid:$passwd  $url -o $local;'
    

    参考文献

    【讨论】:

      猜你喜欢
      • 2013-01-01
      • 2018-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多