[英]How can I pass parameter into bash while scripts it executes are piped in
What I meant is when I am executing bash scripts using this kind of formart: 我的意思是当我使用这种formart执行bash脚本时:
bash < <( curl http://rvm.io/releases/rvm-install-head )
or 要么
curl http://rvm.io/releases/rvm-install-head | bash
How can I pass in extra parameters along with this execution? 如何在执行过程中传递额外的参数?
Thanks 谢谢
Add parameters after -s
switch. 在
-s
切换后添加参数。
Example of use: 使用示例:
echo 'echo params count: ${#@}, params: $@' | bash -s param1 param2
Output: 输出:
params count: 2, params: param1 param2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.