From: Paolo Negri Date: 2007-07-11T17:50:10+09:00 Subject: Re: Help: Efficient regular expression You can process the ps output using other commands. ps -aef|tr -s ' '|cut -d ' ' -f2,8- This will just print your second column the 8th and anything that comes after. At this point your regexp only need to split the string at the first space. Paolo On 11/07/07, Divya Badrinath wrote: > Paolo Negri wrote: > > sorry for being OT since I'm not going to talk about ruby or regexp > > > > If the string you're parsing is an output from the ps command you can > > simplify your life using the -o option that prints only the fields you > > need. > > > > I.E. in gnu Linux > > > > ps -ao pid,command > > > > just outputs pid and command columns. > > Be careful since the command column can contain spaces. > > > > > > Paolo > > i saw that too. But i can not use all the options in a ps command where > i am using. > i am limited to using ps -aef > > i need to take care of fetching the stuff i need using from this result. > > -- > Posted via http://www.ruby-forum.com/. > >