ok so i'm working through a tutorial to get rvm installed on my mac. the bash command to get rvm via curl is
curl -L https://get.rvm.io | bash -s stable
i understand the first half's curl command at location rvm.io, and that the result is piped to the subsequent bash command, but i'm not sure what that command is doing. My questions:
-s : im always confused about how to refer to these. what type of thing is this: a command line argument? a switch? something else?
-s : what is it doing? i have googled for about half an hour but not sure how to refer to it makes it difficult.
stable : what is this?
tl;dr : help me decipher the command bash -s stable
to those answering this post, i aspire to one day be as bash literate as you. until then, opstards such as myself thank you for the help!
Best Answer
The
-s
thing is called an option. In your case, it means thatbash
will be executed with the first positional parameter set. If you want to play with that:In your case, the script downloaded via curl is sent to
bash
(so it will be executed) and will have the first positional parameter set tostable
.If ever you're stuck with options you don't know what they do:
man bash
and then type/-s
this will more or less get you to where the-s
option is described. Or if you want to know what the-u
option does forsed
:man sed
and then type/-u
.Hope this helps!