Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个别名以使用 cURL 获取文件,该文件提示:
我如何能够以交互方式执行此操作,而不是对所有内容进行硬编码?
以下按预期工作:
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;'
参考
使用 cURL 自动化 HTTP 作业
卷曲 - 手动
阅读手册页 - Bash - SS64.com