Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

(I asked an almost identical question on stackoverflow with no response. Am hoping that ask ubuntu is a better spot for this and so am re-asking here.)

I haven't used pipe much and am wondering if I'm doing something wrong. If I run:

bundle show jquery-rails

I get the following:

/home/u1104/.rvm/gems/ruby-1.9.3-p194/gems/jquery-rails-2.0.0

And if I run:

gnome-open /home/u1104/.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-2.0.0

Nautilus opens to the correct location. So I want to save myself the trouble of copying and pasting the results of one command into the other and I thought this was what the pipe was for... but when I run the following:

bundle show jquery-rails | gnome-open

I get the following error:

Usage: gnome-open <url>
/home/u1104/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/vendor/thor/shell/basic.rb:63:in `flush': Broken pipe (Errno::EPIPE)
    from /home/u1104/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/vendor/thor/shell/basic.rb:63:in `say'
...

Is there a way to get the results of my bundle show to automatically open in nautilus?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

You want to pass the output of the bundle command as an argument to gnome-open, not as input to it. Try this instead:

gnome-open $(bundle show jquery-rails)
share|improve this answer
    
Thanks that was super helpful and it did work! –  snowguy Jul 25 '12 at 7:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.