[Gllug] I know this is a bit of a n00b question

Nix nix at esperi.org.uk
Wed Oct 8 06:46:11 UTC 2003


On Tue, 7 Oct 2003, Richard Jones spake:
> On Tue, Oct 07, 2003 at 09:33:49PM +0100, Adrian McMenamin wrote:
>> grep -rl mypassword * | sed -e s/mypassword/dummypassword/g
> 
> The first bit is right, but sed won't rewrite the file in place. It's
> a stream filter. This is what the Perl '-i' option in my example is
> for.

With GNU sed 4.x, this is no longer the case :)

grep -rl mypassword * | sed -i~ -e s/mypassword/dummypassword/g

would edit the files in-place and back the old ones up to files with a
tilde suffix.

Now sed has edit-in-place and shell invocation, grep has a plugin
architecture and you can write network servers in awk... who needs perl?

</troll>

-- 
`If you want a vision of the future, it is a wireless broadband network
 feeding requests for foreign money-laundering assistance into a human
 temporal lobe, forever. With banner ads.' --- John M. Ford

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




More information about the GLLUG mailing list