bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?
Date: Fri, 15 May 2015 09:24:12 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

Hi,

On Fri, May 15, 2015 at 10:22:46AM +0300, Eli Zaretskii wrote:
> > +The @code{PROCINFO["argv"]} array contains all of the command-line 
> > arguments
> > +(after glob expansion and redirection processing on platforms where that 
> > must
> > +be done manually by the program) with subscripts ranging from 0 through
> > address@hidden  For example, @code{PROCINFO["argv"][0]} will contain the 
> > name
> > +by which @command{gawk} was invoked.  Here is an example of how this 
> > feature
> > +may be used:
> 
> I think you should use @samp here, not @code, so that there are quotes
> around these expressions in the printed version.

I tried to follow the style I saw used elsewhere in the manual.  I defer to
Arnold if he'd like to change this.

> > address@hidden
> > +awk 'BEGIN @{ for (i = 0; i < length(PROCINFO["argv"]); i++) print i, 
> > PROCINFO["argv"][i] @}'
> > address@hidden example
> 
> This line is too long, and should be broken into two (with a comment
> that it's a single long line).  Long lines in @example overflow the
> page margins, because TeX won't refill them.

I commented out the '@ignore' directives, and you are correct about this.
I changed it to say instead:

@example
awk '
BEGIN @{
        for (i = 0; i < length(PROCINFO["argv"]); i++)
                print i, PROCINFO["argv"][i]
@}'
@end example

But please keep in mind that this documentation does not actually appear
in the info docs or printed manual, since everything in the "Undocumented"
section is ignored.  So it doesn't actually seem to matter what's in this
section of the manual.

I just pushed the commit.

Regards,
Andy



reply via email to

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