Very nice, simple code Benjamin.  Just the way I like it!

Trev.

-----Original Message-----
From: Benjamin Lee [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 5:26 PM
To: Trevor Ouellette
Cc: e-smith-devinfo
Subject: Re: [e-smith-devinfo] procmail help



I would use Perl.

perl -pi -e 's|\Qkey phrase\E|new sentence|gi;' <file>

This is perl at its simplest (equivalent to a hello world program!) so
I point you to http://www.google.com/.



On Wed, Jul 25, 2001 at 05:11:40PM -0600, Trevor Ouellette wrote:
> Quick question...
>
> I want to write a bash script that can modify a file.  I want to be able
to
> search through a file until it reaches a key phrase or words.  Then I want
> to delete the whole line or replace the key phrase.
>
> If anyone has the time, please point me in the right direction.  I've
> already looked at grep and egrep but I don't know how to pipe (|) a lot of
> the commands in the correct order.
>
> It's for my samba 2.2.1a upgrade script based on Dan Browns howto!
>
> Trev.
>
>
>
> --
> Please report bugs to [EMAIL PROTECTED]
> Please mail [EMAIL PROTECTED] (only) to discuss security issues
> Support for registered customers and partners to [EMAIL PROTECTED]
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Archives by mail and
http://www.mail-archive.com/devinfo%40lists.e-smith.org

--
B.      http://makelinux.org/    "Always real."    http://realthought.net/
__________________________________________________________________________
Life is knowing how far to go without crossing the line.

--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org



--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to