[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: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time? |
Date: |
Wed, 13 May 2015 09:03:53 +0300 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
Hi.
> > While access to the raw argv would be nice, that's not how awk has
> > ever worked, nor is that how POSIX defines it. Sorry.
>
> I respectfully disagree.
>
> For the use case of loading library files from an awk program
> dynamically, this holds true, but for another reason. You cannot use a
> variable to @include files (I guess because the @include directives
> are processed before the BEGIN{}-block gets executed)
Quite correct. @include is processed during scanning and parsing.
> Gawk, however, *does* provide raw access to the ARGV array with the -E
> (or --exec) option.
>
> --exec instructs gawk to not do any processing of the command line.
> You'll get responsibility of processing anything of interest, and
> deleting the processed items from the ARGV array.
Technically, you are correct. But in the context of standard awk,
and/or using the -f and the -i options, my statement holds. These
are definitely the more common contexts.
Also note that -E and its argument do not show up in ARGV. Because of
this, -E does not solve the original poster's question of how to get
the full path name of the script being run.
Thanks,
Arnold
- [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Jim_Dailey, 2015/05/11
- [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Jim_Dailey, 2015/05/11
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Aharon Robbins, 2015/05/11
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, green fox, 2015/05/11
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Aharon Robbins, 2015/05/12
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Joep van Delft, 2015/05/13
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?,
Aharon Robbins <=
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Eli Zaretskii, 2015/05/13
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, arnold, 2015/05/13
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Eli Zaretskii, 2015/05/13
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Aharon Robbins, 2015/05/14
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Andrew J. Schorr, 2015/05/14
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Eli Zaretskii, 2015/05/14
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Aharon Robbins, 2015/05/14
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Eli Zaretskii, 2015/05/14
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Andrew J. Schorr, 2015/05/14
- Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?, Aharon Robbins, 2015/05/14