[Gllug] Search and replace in a whole folder

Raphaël Benard raphy_02_4 at hotmail.com
Tue Dec 4 21:36:58 UTC 2007


Hi,
	
Indeed, it's better. 
I did not know the option -i. 

I still have a lot to learn.

Raphy


> for i in val; do sed s/$2/$3/g "$1/$i"> ./newfolder/$i; done
> 
> I'd also add "s around everything with a variable so that it supports
> spaces and most other vaguely evil characters, but you don't even need a
> script:
> 
> $ sed 's/old/new/g' -i.bak /path/to/files/*
> 
> But I'd rather go with Jason's suggestion of a separately included file.
> 
> Matthew
_________________________________________________________________
Découvrez le blog Messenger Le Meilleur du Web : toutes les vidéos qui buzzent le plus sur Internet !
http://meilleurduweb.spaces.live.com/
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list