From the website for RVM:
bash < <( curl https://rvm.io/releases/rvm-install-head )
What does that first less-than symbol do? What about the <(
? I know this is a stupid question, but I'd love to understand this.
Bash (Bourne Again Shell) is the free and enhanced version of the Bourne shell distributed with Linux and GNU operating systems. Bash is similar to the original, but has added features such as command-line editing.
bash is a sh-compatible command language interpreter that executes commands read from the standard input or from a file. bash also incorporates useful features from the Korn and C shells (ksh and csh).
A command line is a horizontal line on an interface that allows the user to type in various commands. Typically, there is a command prompt at the left side of a screen, with a blank line extending to the right where commands are typed.
Bash's process substitution replaces <( ... )
and >( ... )
with pipes from/to children. Hence the whole thing means "create a pipe from curl ...
, and use it as stdin to bash".
Rather pointless, it would be better written
curl -L https://get.rvm.io | bash
It's called process substitution. The ouput of the curl
command is sent via an anonymous named pipe to the standard input of bash
. Basically what that whole command is doing is executing what's retrieved by curl
as a shell script.
I consider it risky, but some people seem to be OK with it. If you retrieve the file and run it in a separate step, though, you have an opportunity to inspect it first. Whatever you do, if you do it together don't run it as root or under sudo
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With