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: Eli Zaretskii
Subject: Re: [bug-gawk] Can a GAWK script access its full path\name at "run-time?
Date: Wed, 13 May 2015 19:28:04 +0300

> From: Aharon Robbins <address@hidden>
> Date: Wed, 13 May 2015 09:03:53 +0300
> 
> > 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.

How about adding a field to PROCINFO[] where we would save the full
original command line?



reply via email to

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