sed experts. Help

Jared Greenwald greenwaldjared at gmail.com
Thu Oct 23 13:11:45 UTC 2008


On Thu, Oct 23, 2008 at 7:57 AM, Alexander Smirnov
<alexander.v.smirnov at gmail.com> wrote:
> Rick Knight wrote:
>> Sed experts,
>>
>> I have a bunch of php scripts, over 1000, that all need to have 1 line
>> removed. The line begins with...
>>
>> <?php eval(base64_decode(
>>
>> and is at the top of each file. How would I construct a sed command to
>> remove this line from every file in a directory and it's subs?
>>
>> Thanks,
>> Rick
>>
>>
> why sed? you can use excluding option of grep:
> $grep - v  "<?php eval(base64_decode( "
> will match every line but not mentioned.

Sed (with the -i option) has the added benefit of editing in-place.




More information about the kubuntu-users mailing list