[Gllug] I know this is a bit of a n00b question
Adrian McMenamin
adrian at mcmen.demon.co.uk
Tue Oct 7 20:33:49 UTC 2003
On Tuesday 07 October 2003 21:25, Richard Jones wrote:
> On Tue, Oct 07, 2003 at 08:56:18PM +0100, Adrian McMenamin wrote:
> > But I want to do search and replace on the command line with a whole load
> > of perl files (they have hard coded passwords etc in them and I am
> > releasing the code under the GPL) without writing a perl script to do it.
>
> Minix used to have a nice program called gres ('grep and substitute') which
> solved this.
>
> Anyway, this is what I use:
>
> perl -pi.bak -e 's/oldpassword/replacement/g' `find -name '*.pl'`
>
Discovered sed, but while I think something like:
grep -rl mypassword * | sed -e s/mypassword/dummypassword/g
ought to work, it doesn't, sor at least I cannot find the dight sysntax to get
it to work
Adrian
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list