I dont quite understand how pipes work in bash.
I know that it takes an output from one command as the input in another command.
What an output is I can get because it's what the command prints out to the screen.
But how do I know what input a command will take?
Here is an example I thought would work:
which gem | rm
Unfortunately it didn't.
Which gem prints out /usr/bin/gem
so that must be the output right?
I thought that was given to rm so it woud be rm /usr/bin/gem
but I was wrong.
So my question is, how do I know what input a command takes?
rm /usr/bin/gem
is a terrible idea. Leave thatgem
(and the Ruby interpreter it goes with) alone and install your preferred Ruby interpreter (andgem
) usingrvm
: rvm.beginrescueend.com