login
Header Space

 
 

Re: find -exec {} help

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <root@...>, David B. <incomex@...>, <misc@...>
Date: Monday, June 4, 2007 - 8:25 am

Hello!

On Mon, Jun 04, 2007 at 02:01:12PM +0200, Marc Espie wrote:




This isn't safe wrt newlines in file names, either.

A completely safe solution would be writing a small script:

#! /bin/sh
exec sed s/old/new/ < "$1" > "$1".new

and using find . -type f -name \*.htm -exec /path/to/script {} \;
or find . -type f -name \*.htm -print0 | xargs -0 -L 1 -r /path/to/script

Kind regards,

Hannah.
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