Gentoo Archives: gentoo-dev

From: Patrice Clement <monsieurp@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place
Date: Fri, 20 May 2016 19:32:38
Message-Id: 20160520193222.GE16750@ultrachro.me
In Reply to: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place by Mike Frysinger
1 Thursday 19 May 2016 23:08:05, Mike Frysinger wrote :
2 > On 18 May 2016 22:25, aidecoe@g.o wrote:
3 > > awk doesn't have the -i option like sed and if editing file in place is
4 > > desired, additional steps are required. eawk uses tmp file to make it
5 > > look to the caller editing happens in place.
6 >
7 > what's your real use case ? i've never once thought "man, i wish i could
8 > run an awk script and modify a file in place". and i write awk most days.
9 > -mike
10
11 Same question. Why would you ever want to run awk and have it in-place edit a
12 file? Have you ever heard about Perl? In place editing a file with it is as
13 easy as ABC:
14
15 $ perl -i'' -ne 's/foo/bar/g;' file.txt
16
17 And you're done. If you don't fancy Perl, you could use Ruby with the exact
18 same syntax and it works just as well. Then add either of these to DEPEND and
19 you're set.
20
21 Please walk us through why you actually want this function to be added cause I
22 read this thread and your diff like 10 times and couldn't come up with a
23 sensible reason which would justify this change.
24
25 --
26 Patrice Clement
27 Gentoo Linux developer
28 http://www.gentoo.org

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies