login
Header Space

 
 

find -exec {} help

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <misc@...>
Date: Monday, June 4, 2007 - 3:04 am

hi, I'm using 3.8, and I hate to bother, but I have spent two days on the 
net trying to find the answer to this problem.

I am using 'find' to batch file a sed search and replace.  Sed, of course, 
outputs to stdout, the problem I am having is finding the correct syntax so 
that I can change the extension of the input file to create the new output 
file.  For example:

Find . -name "*.htm" -exec 'sed s/old/new/' > '{}'.new

so if the input file happens to be smith.htm, then '{}' would be smith.htm 
and the idea is that the output filename for the sed command would create a 
new output file called smith.htm.new.

this of course isn't working.

any help please? thanks.

david
incomex@hotmail.com

_________________________________________________________________
PC Magazines 2007 editors choice for best Web mailaward-winning Windows 
Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_...
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
find -exec {} help, David B., (Mon Jun 4, 3:04 am)
Re: find -exec {} help, Stuart Henderson, (Mon Jun 4, 5:35 am)
Re: find -exec {} help, Almir Karic, (Mon Jun 4, 4:14 am)
Re: find -exec {} help, Bryan Irvine, (Mon Jun 4, 3:30 am)
Re: find -exec {} help, Marc Espie, (Mon Jun 4, 8:01 am)
Re: find -exec {} help, Martin Schröder, (Mon Jun 4, 9:26 am)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 11:28 am)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 8:25 am)
Re: find -exec {} help, Marc Espie, (Mon Jun 4, 4:46 pm)
Re: find -exec {} help, Tom Van Looy, (Mon Jun 4, 12:54 pm)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 4:30 pm)
Re: find -exec {} help, terry tyson, (Mon Jun 4, 5:37 pm)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 6:04 pm)
Re: find -exec {} help, Almir Karic, (Mon Jun 4, 12:27 pm)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 12:58 pm)
Re: find -exec {} help, Almir Karic, (Mon Jun 4, 1:49 pm)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 4:32 pm)
Re: find -exec {} help, Almir Karic, (Mon Jun 4, 5:45 pm)
Re: find -exec {} help, Hannah Schroeter, (Mon Jun 4, 6:21 pm)
Re: find -exec {} help, Marc Espie, (Mon Jun 4, 6:19 pm)
Re: find -exec {} help, Almir Karic, (Tue Jun 5, 2:20 am)
Re: find -exec {} help, Antti Harri, (Mon Jun 4, 3:24 am)
speck-geostationary