sed experts. Help
P Kapat
kap4lin at gmail.com
Thu Oct 23 05:32:31 UTC 2008
On Thu, Oct 23, 2008 at 12:54 AM, Jared Greenwald
<greenwaldjared at gmail.com> wrote:
> there's nothing that says you need to do all the files in one sed
> command, right?
>
> something like this should work...
>
> find <dir> -type f -exec sed -i.bak 's/^<?php eval(base64_decode(.*.$//' {} \;
if you know that it is _always_ the first line then you could do:
find <dir> -type f -exec sed -i.bak '1d' {} \;
this will delete the first line from every file and keep any other
lines that begin with "<?php eval(base64_decode(" intact.
> ...Not only will it do all the line removal, it will also make backups
> (as <file>.bak) so if you screw up you will have the original files to
> revert.
--
Regards
PK
--------------------------------------
http://counter.li.org #402424
More information about the kubuntu-users
mailing list