Reputation: 1814
I have zshell, and an alias for sublime text 2
I often look at the source of bundled gems, so I'll run this
bundle show gemname
-> outputs the path which I have to copy
subl path/to/gem
I want to pass the output of the first command into the alias as it's argument.
Is something like this possible with aliases:
bundle show gemname | subl
Or some variation thereof?
I'm not very familiar with the full suite of unix command line capability.
Upvotes: 0
Views: 82
Reputation: 4856
I believe that this should do exactly what you want:
subl `bundle show gemname`
Note the backtick characters, which is usually the key to the left of the 1 key and also below the esc key on a typical keyboard. This says to run the command in the backticks and use it's output in the outer command.
Upvotes: 3