Re: whats wrong with find -exec sed?
- From: birre <spamtrap@xxxxxxxxxxxx>
- Date: Fri, 03 Nov 2006 12:14:23 +0100
On 2006-11-02 14:04, tom wrote:
Hi there,
i am getting mad. whats wrong with this?
find . -iname "*.pl" -exec sed 's/[.\/]*\/perl\/bin\/perl -I[.\/]*\/perl\/lib/\/usr\/bin\/perl/w {}' {}\;
note: everything is in one line. Thunderbird makes 2 of it.
I want to find all perl files ending with .pl, get them sed'ed and write back the result. It works without writing the files back and I can even produce one big file with all changes in it. But I need the changes in every single file.
What's wrong with that approach? Bash tells me "find: missing argument to `-exec'"
Thanks so much,
Thomas
Since you know what perl is, why not use it :-)
perl -pi -e 's,from,to,' `find . -iname \*.pl -print`
As other writes, you are not forced to use / as delimiter ,
so in this case, use , or something else.
If you have space in the filename of your perl scripts, this will fail,
and you must use:
find . -iname \*.pl -print0 | xargs -0 perl -pi -e 's,from,to,'
/birre
.
- Follow-Ups:
- Re: whats wrong with find -exec sed?
- From: Michal Nazarewicz
- Re: whats wrong with find -exec sed?
- References:
- whats wrong with find -exec sed?
- From: tom
- whats wrong with find -exec sed?
- Prev by Date: Re: Intel Core 2 Duo and linux
- Next by Date: Re: Intel Core 2 Duo and linux
- Previous by thread: Re: whats wrong with find -exec sed?
- Next by thread: Re: whats wrong with find -exec sed?
- Index(es):
Relevant Pages
|