David Heinemeier Hansson wrote:
>Bil wrote:
>> I.e., why isn't this a ruby command instead of sed?
>> 
>>  $ sed -i '/^#!/{s,local/,,}' public/dispatch.{cgi,fcgi,rb} 
> 
> That's the wonderful power of the wikis. You perceive this as a bug and 
> with the Edit link at the bottom of the page, you have the power to 
> change it! So I expect to see a new revision of that page edited by Bil 
> Kleb shortly ;)

I would, but let the truth be known: My command-line ruby is so poor that
my sed equivalent is too Perl:

  ruby -pi -e \$_.sub\!\(/^\(#\!.*\)local\\\//,\'\\\1\'\) public/dispatch.{rb,cgi,fcgi}

due to trouble with getting '\1' inside the argument to -e when using bash.

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?

-- 
Bil, Hampton, Virginia