bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] in-place edit request


From: Davide Brini
Subject: Re: [bug-gawk] in-place edit request
Date: Sun, 23 Dec 2012 18:15:01 +0100

On Sun, 23 Dec 2012 10:52:20 -0600, Ed Morton <address@hidden>
wrote:

> Arnold - thanks for getting back to me. I responded at comp.lang.awk. The
> shell script solution is horrible. If I want to change "foo" to "bar" for
> all the files in my directory I have these choices:
> 
>     find . -type f -exec sed -i 's/foo/bar/g' {} \;
> 
>     find . -type f -exec sh -c (awk '{gsub(/foo/,"bar"}1' {} > tmp/tmp$$
> && mv /tmp/tmp$$ {} \;')
> 
> and I'm sure I got the syntax of that shell+awk solution wrong.
> 
> It's just too lengthy, complicated, and error prone and even for more
> involved scripts it makes people choose complicated sed solutions over
> trivial awk solutions.

Just FYI, there is some talk on the bug-coreutils mailing list about
developing a generic "inplace/rewrite" utility that would provide
(pseudo-)in-place editing for any edit/filter utility, even those that do
not support it.

Here is a recent thread on the subject:

http://lists.gnu.org/archive/html/bug-coreutils/2012-11/msg00185.html


-- 
D.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]