<(command)
creates a named pipe with the output of the command (or uses an existing /dev/fd
file), and substitutes the filename of that pipe into the command. <
then redirects standard input from that given file.
So yes, in this case, this is equivalent to
curl http://rvm.io/releases/rvm-install-head | bash
I'm not sure why they suggest the more complicated and less portable version. In some cases, you would prefer the version using < <()
to the version using a pipe, as the pipe creates a subshell for the command receiving input (in this case, bash
), while the < <()
creates a subshell for the command producing output. If you use a pipe, then the command in the subshell can't modify variables in the shell environment, which is sometimes desired (if you wanted to pipe something to a while read ...
command). However, in this case, the output of the command is just being passed directly to an explicit invocation of bash
; there is nothing that needs to be run from the parent shell here.