Perl Basics
Introduction to Perl
FAQ's
CGI
Regular Expressions

PC Overview
Cool Stuff
My Modules
Success Stories
Links
Perl in the News
Logos

PC Internals
About
Contact
Handy Logos
What's new

Cool Stuff

See also Perl Cool Search
P-friendly

[ home ] - [ search ] - [ sitemap ]


Imagine you had to replace text within an amount of files at your shell prompt:

[retoh@talisker retoh]$ ls -l cool*.abc
-rw-rw-r--    1 retoh    retoh          12 Jun  5 08:19 cool-1.abc
-rw-rw-r--    1 retoh    retoh           6 Jun  5 08:19 cool-2.abc

To replace the string "BODY" with "body" within all files matching the search criteria just type:

find -name "cool*.abc" -print | xargs perl -pi -e "s/BODY/body/;"
home - feedback - search

$Id: cool.htm,v 1.6 2004/03/23 01:13:00 reto Exp $
© 1998-2004 reto :)