Bash相关技巧

执行输入命令附带参数

有时候需要使用 curl 命令输出远程脚本给 Bash 执行,如果需要附带参数,可以:

curl http://example.com/script.sh | bash -s -- arg1 arg2

即使 Bash 的输入是用 echo 输出的也可以使用。