bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] How to print default values of awk built in variables?


From: Andrew J. Schorr
Subject: Re: [bug-gawk] How to print default values of awk built in variables?
Date: Mon, 8 Oct 2012 11:28:30 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Mon, Oct 08, 2012 at 10:06:15AM -0500, Peng Yu wrote:
> I feel that it will be convenient if there is a way to print all the
> builtin variables and their values (I can always check the manual
> which I feel less convenient). But I don't find an option to do so. Is
> there such an option that I overlooked? If there is not one available,
> can I suggest add one? Thanks!

An experimental SYMTAB feature is actually in the current development master 
branch here:
        git clone git://git.savannah.gnu.org/gawk.git
But it has not been released yet.  You can download a snapshot tarball here if 
you
would like to experiment with this feature:
        
http://sourceforge.net/projects/gawkextlib/files/gawk-4.0.70.tar.gz/download

With this development version, you can say:

   bash-4.1$ ./gawk 'BEGIN {for (i in SYMTAB) print i, (isarray(SYMTAB[i]) ? 
"array" : SYMTAB[i])}'
   ARGV array
   i i
   ROUNDMODE N
   ORS 

   OFS  
   LINT 0
   FNR 0
   ERRNO 
   NR 0
   IGNORECASE 0
   TEXTDOMAIN messages
   NF -1
   ARGIND 0
   ARGC 1
   FIELDWIDTHS 
   CONVFMT %.6g
   SUBSEP 
   PREC 53
   RS 

   FPAT [^[:space:]]+
   RT 
   RLENGTH 0
   OFMT %.6g
   FS  
   RSTART 0
   FILENAME 
   BINMODE 0

Regards,
Andy



reply via email to

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