[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell script



On Mon, Jan 29, 2001 at 01:39:23AM +0100, William Leese wrote:
> Hi,
> 
> i'm trying to write a simple script that will do several things:
> 
> 1) merge 3 files in a predefined order
> 
> 2) replace a few words in one of the files to be merged, the values with 
> which the words will be replaced must be given(/requested).

Try this:

$perl -i.orig -pe 's/\bfoo\b/bar/g' *.[Cchy]

Rename all "foo" to "bar" in all files ending with C, c, h or y.
Backup-copies will be called *.orig


-- 
Thomas Guettler
Office: <guettli@interface-business.de> www.interface-business.de
Private:<guettli@gmx.de>  http://yi.org/guettli



Reply to: