[Gllug] error in bash script to rename files in a directory

Pete Ryland pdr at pdr.cx
Mon Dec 30 18:57:58 UTC 2002


On Fri, 2002-12-27 at 23:44, Liam Delahunty wrote:
>  :1,$s/php3/php/g

The '1,$' can be abbreviated as '%'. :)

Alternatively, if you don't want to open each file in turn in vi for
this, you could instead do this:

$ perl -p -i.bak -e 's/php3/php/g' *

which would do the same.  The -i.bak creates a backup.

Pete

-- 
Pete Ryland
http://pdr.cx/


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list