From: Andrew Johnson Date: 2004-10-06T08:39:50+09:00 Subject: Re: ruby to replace sed command (was Re: http://www.rubyonrails.org/show/GettingStartedWithRails) On Wed, 6 Oct 2004 07:12:30 +0900, Bil Kleb wrote: > The following is cleaner but does not follow the sed command's behavior > and is still too Perlish for my tastes: > > ruby -pi -e '$_.sub!(/local\//,"") if $_=~/^#!/' public/dispatch.{rb,cgi,fcgi} > > Anyone? How about: ruby -pi -e '~/^#!/&&$_[/local\//]=""' files andrew