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: Ed Morton
Subject: Re: [bug-gawk] in-place edit request
Date: Mon, 31 Dec 2012 11:20:19 -0600
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0

Andy -

On 12/31/2012 10:40 AM, Andrew J. Schorr wrote:
On Mon, Dec 31, 2012 at 09:03:14AM -0600, Ed Morton wrote:
I understand from this email exchange that -i is being used by gawk
for something else (though I don't see it mentioned at
http://www.gnu.org/software/gawk/manual/gawk.html#Options so I'm not
sure what) so I assume that -i , unfortunately, is off the table (is
it?) but is it really not possible to use "-<capital-i>" or some
other single character so we can have:

     sed -i 'script' file
     perl -i 'script' file
     ruby -i 'script' file
     awk -I 'script' file

Right now the chosen implementation is driving the interface.
Couldn't we retain that implementation but also provide the
interface the users would expect even if it means a little more code
internally to map "-I" to the "-i inplace" functionality?
If we use an gawk command-line option, then we need to incorporate
the functionality inside gawk instead of implementing it as an
extension.

This "extension" stuff - where can I find out more about it? I found http://www.gnu.org/software/gawk/manual/gawk.html#Dynamic-Extensions but it doesn't mention "-i" so I'm not sure if that's the right "extension"s we're talking about.

Would users need to compile gawk in some specific way (or otherwise have to do something they don't normally do) to be able to use the in place editing functionality if it was provided by "extension"s or would we just get it for no additional effort when we download the gawk version that has it? I get my gawk from cygwin or from our IT guys at work just installing the latest version occasionally, I never have to compile it myself.

There is nothing stopping anyone from writing a one line wrapper:

        $ cat aip       # Awk In Place
        #! /bin/sh
        exec gawk -i inplace "$@"
Or one could name this script "gawki" if you'd like.  Or gawk-i.

Is it really worth bringing this feature into the main binary for the
sake of having a space between "gawk" and "-i"?
Not sure I understand the question. We're discussing the difference to the user between "gawk -i inplace" and "gawk -I" (or similar) not the difference between "gawk -i" and "gawki".

     Ed.



reply via email to

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