[Gllug] Awk Sed

Alex Hudson home at alexhudson.com
Thu Dec 6 19:43:53 UTC 2001


On Thu, 2001-12-06 at 19:20, harry wrote:
> If I wanted to change the same pattern in mutiple files held in a directory 
> do I use sed or awk.

Actually, you'd use Perl ;)

For example, if I were to have a sex change, I might

	perl -p -i'.orig' -e 's/(Alex)/$1andria/g;' *

Not only does this change my name everywhere, it even backs up my files
in case I make a mistake.

> Also is there anywhere on a linux machine where you can get  decent examples 
> of how to use a tool. I know that the man pages are there but they are an 
> absolute nightmare to decipher.

man perlrun is fairly good, and not as difficult as some man pages. man
perlre too. Otherwise, there's the O'Reilly books, perlmonks.org,
useperl.org, etc. etc.O'Reilly Perl cd bookshelf can be installed on
your machine, and the websites are even available on Windows :)

Cheers,

Alex.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20011206/14b6be49/attachment.pgp>


More information about the GLLUG mailing list