O'Reilly publishes a book called "Mastering Regular Expressions".  It 
claims to be for people who have never used them before.  Even so, while I 
don't consider myself any better than the average bear, I also don't feel 
I quite fall into the dummy category either.  Nevertheless I find the 
subject difficult.

Tom Curl
Enertex Systems





<[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
01/03/01 11:22 AM
Please respond to redhat-list

 
        To:     <[EMAIL PROTECTED]>
        cc: 
        Subject:        RE: Whole word substitution with sed [Solved]


And the winner is... :-)

> echo $flist | sed -e "s/ $fn / /"

Although Luke's solution also works, yours is simpler (after changing 
flist
from "abcde bc de" to ". abcde bc de ." -- see my reply to Luke for
details).

And this begs the question -- how does one know when single quotes, double
quotes or no quotes are appropriate?  Is there a "regexp for Dummies"
document out there (the man page is a bit thick)?

> You could also use 'awk'.

Any chance you can provide an example?

Thanks for your help!

bd


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dave Ihnat
Sent: Wednesday, January 03, 2001 5:21 AM
To: [EMAIL PROTECTED]
Subject: Re: Whole word substitution with sed


On Tue, Jan 02, 2001 at 09:55:23PM -0800, [EMAIL PROTECTED] wrote:
> I have a list of space delimited  filenames in a variable 'flist', and I
> want to remove one of them which is in a variable 'fn'.  ...
> ...

Do
                 echo $flist | sed -e "s/ $fn / /"

Note the included delimiters on either side of the variable, and the
retention
of one delimiter in the substitution string.

You could also use 'awk'.

Cheers,
--
                 Dave Ihnat
                 [EMAIL PROTECTED]



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



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





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

Reply via email to