Just a thought on sed
mail at chthon.freeserve.co.uk
Fri May 3 09:27:18 PDT 2002
me too - plus then we dont need backups
plus just one simple command.
"Chad Simmons" <polpak at yahoo.com> wrote in message
news:20020503161152.6725.qmail at web13706.mail.yahoo.com...
> --- Chad Simmons <polpak at yahoo.com> wrote:
> > --- Marc Heerdink <marc at linuxfromscratch.org> wrote:
> > > We currently only have these constructs:
> > >
> > > mv file file.backup &&
> > > sed 's/foo/bar/g' file.backup >file
> > >
> > > thus saving a backup copy in case something went wrong. Modifying a
> > > in place would only be possible if we'd do it like this:
> > >
> > > cp file file.backup &&
> > > perl -i -pe 's/foo/bar/g' file
> > >
> > > and we'd have 2 lines of commands anyway.
> > Actually, the options here allow you to specify a backup also..
> > perl -i.backup -pe 's/foo/bar/g' file
> > The above will accomplish the same as your 2 line version above
> Oh, and for the record.. I think perl is great, but I personally vote for
> files above both sed and perl.
> Chad Simmons
> -----BEGIN GEEK CODE BLOCK-----
> Version 3.1
> GCS/L/C/O d-(+) s++:+ a-- C+++$>++++ UBLS++++$
> P+++(--)$ L++>+++ E--- W+>++$ N !o K? w(--) !O
> M- !V PS+ PE(++) Y+ PGP->+ t- 5 X+() R(+) tv+@
> b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
> ------END GEEK CODE BLOCK------
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> Unsubscribe: send email to listar at linuxfromscratch.org
> and put 'unsubscribe lfs-dev' in the subject header of the message
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message
More information about the lfs-dev