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

Re: [linux-team] replace massif



On Wed, Aug 25, 1999 at 06:49:03PM +0200, Frederic Dumont wrote:
> On Wed, Aug 25, 1999 at 06:36:49PM +0200, aef@salsa.be.eu.org wrote:
> > Quelle est la commande qui permet de remplacer la 
> > chaine "brol" par "truc" dans tous les fichiers *.html 
> > du repertoire /home/coucou ?
> 
> Une facon de faire, avec bash et sed:
> cd /home/coucou ; for i in *.html; do mv -i $i `echo $i | sed -e 's/brol/truc/'`; done

héhé... trop long! =)

Perl power:

find /home/coucou/ -name '*.html' | xargs perl -pni.bak 's/brol/truc/g'

En plus, il fait automatiquement un backup (.bak) :)

-- 
  -o) / Pascal Bleser          ATOS Payment Systems|
  /\\ \ C++/UNIX Development        Aachen, Germany|
 _\_v  \<guru@linuxbe.org> <pbleser@atos-group.com>|
---------------------------------------------------|
Real programmers don't comment their code.         :
It was hard to write, it should be hard to         :
understand.                                        :
---------------------------------------------------'

---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.