From: Alan Chen Date: 2002-09-17T04:16:53+09:00 Subject: Re: back tick equivalent On Tue, Sep 17, 2002 at 04:04:24AM +0900, CHENG, WEI CHI (LNG) wrote: > Just install ruby last Friday and tried to find the back tick equivalent as > in shell script or perl to get the program output w/o resort to some popen > trickery. Can not find it in the reference book or faq ? > > e.g. what is the equivalent of below perl statement > > @psout = `ps -elf | grep myusername`; Backticks should work the same in ruby, if you want an array of lines, you can do the following, psout = `ps -elf | grep myusername`.split("\n") without the .split("\n") you'd get one large string. -- alan -- Alan Chen Digikata LLC http://digikata.com