0

What I meant is when I am executing bash scripts using this kind of formart:

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

Zhenkai
  • 318
  • 3
  • 15
  • Do you mean something as simple as `curl http://rvm.io/releases/rvm-install-head -otherparam | bash -moreparams -yetmoreparams`? – sapi Apr 08 '13 at 05:46
  • 1
    I just find this question is duplicated with this http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl?rq=1 – Zhenkai Apr 08 '13 at 05:46

1 Answers1

3

Add parameters after -s switch.

Example of use:

echo 'echo params count: ${#@}, params: $@' | bash -s param1 param2

Output:

params count: 2, params: param1 param2
loentar
  • 5,111
  • 1
  • 24
  • 25