[prog] using sed on multiple files

Kathryn Andersen kat_lists at katspace.homelinux.org
Sat Jul 9 07:18:36 EST 2005


On Fri, Jul 08, 2005 at 12:16:05PM -0400, Nicki Handy wrote:
> Hi, I want to use the sed command on multiple files so that I can 
> replace a piece of text in each of the files. The problem is the 
> output- I can run the command fine on the whole directory but I don't 
> want to have to specify the file to output, I just want it to change 
> the file it's on.
> 
> For example, this works.....
> machine# find ./ -type f -exec sed -e 's/051201/081201' {} \;

An alternative would be to use the rpl command.
http://www.laffeycomputer.com/rpl.html

This does replacements on multiple files, though it's not as powerful as
sed, but if just replacements is what you want, it could be the program
for the job.

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe


More information about the Programming mailing list