From: Brian Candler Date: 2009-01-07T19:28:16+09:00 Subject: Re: A question about running external program Zhao Yi wrote: > I use this method to run an external program: > > output=`uname -r | sed 's/\([^\.]*\.[^\.]*\)\.*.*/\1/'` > puts output > > ruby will ignore the sed command. Doesn't ruby support "|"? That's not a smart question. - Show what happens if you run the same script at the command line - Show what 'output' actually contains when doing this in Ruby - Show what version of Ruby you are using, and under what platform FWIW, it works just fine for me under Ubuntu Hardy with ruby-1.8.6 compiled from source: $ ruby -v ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux] $ irb irb(main):001:0> output=`uname -r | sed 's/\([^\.]*\.[^\.]*\)\.*.*/\1/'` => "2.6.24-22-386\n" -- Posted via http://www.ruby-forum.com/.