Oh, I do that one, too. I use about a million different ways of doing things in UNIX scripting, just to keep myself from getting bored. I’d still like to figure out how to do it in Ruby, though. :)— On Fri 03/05, =?iso-8859-1?q?Thomas=20Adam?= < thomas_adam16@yahoo.com > wrote:From: =?iso-8859-1?q?Thomas=20Adam?= [mailto: thomas_adam16@yahoo.com]To: ruby-talk@ruby-lang.orgDate: Sat, 6 Mar 2004 03:18:49 +0900Subject: Re: Ruby translation for UNIX scripting command— Thomas Luedeke wrote: > pattern “test”, and printing the fourth field, I’d do a grep plus awk> command such as:grep “test” file_name | awk ’ { print $4 } ’ >>> output_fileHowever, in my Ruby books, I don’t see any discussion aboutYou win the UuoGA (Useless Use of Grep Award). Why not let awk to thepattern matching?awk ‘/test/ {print $4}’ < file_name >> ./some_other_file-- Thomas Adam=
====“The Linux Weekend Mechanic” – http://linuxgazette.net"TAG Editor" – http://linuxgaz
ette.net" We’ll just save up your sins, Thomas, and punish you for all of them at once when you get better. The experience will probably kill you. :)"-- Benjamin A. Okopnik (Linux Gazette Technical Editor)___________________________________________________________Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html