Do you want to remove the entire line if they *begin with those
characters? If so, creating the following file, making it executable and
running it will do this.

#!/usr/local/bin/perl -ni
# convert.pl
# usage: ./convert.pl file1 file2 file3 ...
next if /^[; ]/;
next if /^.com/;
next if /\.(ROOT|GTLD)-/;
print;

the -n switch does what -p does, but does not print the line by default
I combined a few of the similar matches. You could write it in one big
(but harder to understand) regex if you wanted to.

hth
charles

On Wed, 13 Sep 2000, Chris S wrote:

> what if i have other strings in a file other than "NOT NULL" that i want to 
> get rid of?  can i still get away with one command or do i have to use a 
> separate command for each string?
> in my file i want to get rid of all lines beginning with:
> ;
> blank space
> .com
> <all characters>.ROOT-
> <all characters>.GTLD-
> 
> thanks for any advice.
> 
> >From: rpjday <[EMAIL PROTECTED]>
> >On Mon, 11 Sep 2000, Dan Browning wrote:
> >
> > > what command do I use to substitute all occurences of a certain string 
> >(say,
> > > "NOT NULL") with another arbitrary string, (e.g. "")?  I've tried grep 
> >and
> > > tr, but can't figure it out.
> >
> >perl -pi -e "s/NOT NULL/bill gates is a donut/g" <filename>



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to