[prog] using sed on multiple files

Nicki Handy nicki at virtualnicki.com
Sat Jul 9 02:16:05 EST 2005


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' {} \;

But I need it to permanently make the change not just spit the output 
to STDOUT
I can add a w but it needs to be dymanic

# find ./ -type f -exec sed -e 's/051201/081201/w' {} \;

Anyone know how to accomplish this?

Thanks,
Nicki




More information about the Programming mailing list