I’ve seen that rvm (ruby version manager) is installed using the following command:
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
So as I understand we get the script content and pass it to the bash (I believe < < and << is the same thing?)
I am interested in the < < part, found following description on the net:
<<token Means use the current input stream as STDIN for the program until token is seen.
This is somehow not clear for me, can someone make an example or explain it in more simple way?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
No, < < and << are not the same thing.
The first is composed of the common < redirection character combined with the first character of the <(command) syntax. This is a ksh construct (also found in bash and zsh) known as process substitution that takes the output of command and provides it in a file whose name refers to the other end of the pipe command is writing to.
In other word you can think of < <(command) as < file, where file contains the output of command.
Method 2
It is a convoluted way of doing the simpler:
curl -s https://raw.github.com/... | bash
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0