What"s wrong with this line of code?
am 10.05.2005 20:19:54 von JeffHowlerperl -pi -e 's/require\(\'includes\/application_top.php\'\);//g' *.php
Can anyone tell me why this expression won't work? I've been staring at it
too long. Thanks!
perl -pi -e 's/require\(\'includes\/application_top.php\'\);//g' *.php
Can anyone tell me why this expression won't work? I've been staring at it
too long. Thanks!
JeffHowler wrote:
> perl -pi -e 's/require\(\'includes\/application_top.php\'\);//g' *.php
>
> Can anyone tell me why this expression won't work? I've been staring at it
> too long. Thanks!
The shell interprets the line before perl sees it so the escaped single quotes
won't work:
perl -pi -e"s/require\('includes\/application_top.php'\);//g" *.php
Or if you really need single quotes for -e'':
perl -pi -e's/require\('\''includes\/application_top.php'\''\);//g' *.php
Or:
perl -pi -e's/require\(\047includes\/application_top.php\047\);//g' *.php
John
--
use Perl;
program
fulfillment
Thanks John, it worked perfectly! Very informative, too.
> The shell interprets the line before perl sees it so the escaped
> single quotes won't work:
>
> perl -pi -e"s/require\('includes\/application_top.php'\);//g" *.php
>
>
> Or if you really need single quotes for -e'':
>
> perl -pi -e's/require\('\''includes\/application_top.php'\''\);//g'
> *.php
>
> Or:
>
> perl -pi -e's/require\(\047includes\/application_top.php\047\);//g'
> *.php
>
>
> John