From: dagbrown@... (Dave Brown) Date: 2003-08-27T02:48:17+09:00 Subject: Re: Ruby launching system apps? In article <5AB6790A-D747-11D7-AD65-000393876156@cox.net>, Mark Wilson wrote: : : On Monday, August 25, 2003, at 05:05 PM, Mark J. Reed wrote: : : > On Monday, August 25, 2003, at 01:25 PM, Dan wrote: : >> I have a UNIX machine and I want a ruby app that can launch UNIX : >> commands like awk or sed...how would I implement this? : > : > The Shell module lets you invoke UNIX commands, but bear in mind : > that doing so is inefficient, : : Avoid premature optimization. If the inefficiency is a problem, : implement in Ruby. If it is still a problem, extend Ruby with C. On the other hand, always think of the poor schmuck who has to maintain your code after you're done wih it. foo.gsub(/ook/,"blat") is way easier to read than, er, IO.popen("sed 's/ook/blat/g') do |p| p.print "ook\n" end and it's far more obvious what you're trying to accomplish. --Dave -- "Some call me '^F[a-z\'-]+$', but I have many names". -- Malcolm Ray