[Top][All Lists]
[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.
- Re: [bug-gawk] in-place edit request, (continued)
- Re: [bug-gawk] in-place edit request, Andrew J. Schorr, 2012/12/23
- Re: [bug-gawk] in-place edit request, Aharon Robbins, 2012/12/25
- Re: [bug-gawk] in-place edit request, Assaf Gordon, 2012/12/25
- Re: [bug-gawk] in-place edit request, Andrew J. Schorr, 2012/12/26
- Re: [bug-gawk] in-place edit request, Andrew J. Schorr, 2012/12/26
- Re: [bug-gawk] in-place edit request, Andrew J. Schorr, 2012/12/26
- Re: [bug-gawk] in-place edit request, Aharon Robbins, 2012/12/26
- Re: [bug-gawk] in-place edit request, Andrew J. Schorr, 2012/12/26
Re: [bug-gawk] in-place edit request, Aharon Robbins, 2012/12/23