-f
Fail silently (no output at all) on HTTP error-s
Silent mode-S
Show error even when -s is used-L
Follow redirects
常用参数组合
下载一段脚本并执行
1 | curl -fsSL http://xxx.sh | bash |
参数保证只有当下载成功时才会有脚本执行,否则会报错退出(如果是 HTTP 连接错误那么会不报错直接退出)
-f
Fail silently (no output at all) on HTTP error-s
Silent mode-S
Show error even when -s is used-L
Follow redirects1 | curl -fsSL http://xxx.sh | bash |
参数保证只有当下载成功时才会有脚本执行,否则会报错退出(如果是 HTTP 连接错误那么会不报错直接退出)