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: Aharon Robbins
Subject: Re: [bug-gawk] in-place edit request
Date: Wed, 02 Jan 2013 21:33:57 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Hi Manuel.

> Just an additional thought. The -i behavior of Perl and Ruby, is usually 
> combined with an additional -p flag that makes the final 'print' statement 
> unnecessary.

In sed the -p counters a #n or -n option. I don't know (nor particularly
care) what Ruby does.

> I.e., in gawk it would implicitly add a final '{print}' rule 
> to the whole awk program. This -p flags makes sense by itself, not only as 
> a -i companion.

I don't think so.

In any case, I have always been of the opinion that if you mean `` print ''
you should say `` print ''.  (The comp.lang.awk guys love to write programs
of the form

        awk '/pattern/ {action}1'

where the trailing one is really a separate pattern that forces a print.
Lovely, eh?)

> I assume this feature cannot be implemented with the current extension 
> mechanism,

Right.

> so it would be probably better to disregard it.

Right.

> But anyway I think it is worth just to mention it (perhaps in the inplace
> extension documentation).

We can hope that when Andy finds a volunteer to write the doc, s/he will
have seen your note and mention this.

Thanks,

Arnold



reply via email to

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