On Aug 2, Messervy, Joe M said:
>I want to get rid of machine1, machine2, and machine4 as there were no
>matching logs for these events.
>I tried as a test perl -p -i -e 's//nmachine//g' myfile and get the
>following error:
>Illegal division by zero at -e line 1, <> line 1. (and all data is lost in
>myfile).
Um, you have an extra / in your s///. Also, there is no "nmachine" in
your file.
You MEANT to do
s/nmachine//g;
but you probably REALLY meant to do
perl -n -i -e 'print unless /machine/' myfile
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]