"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/test/symtab11.awk" (7 Mar 2020, 754 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) (G)AWK source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 BEGIN {
    2     PROCINFO["sorted_in"] = "@val_type_asc" # okay with PROCINFO commented out, kaboom if not
    3     IGNORECASE = 1  # yes
    4 
    5     printf("BEGIN -- Symtab is next\n") > "/dev/stdout"
    6     for (i in SYMTAB) {
    7         printf "[%s] = %s\n", i, isarray(SYMTAB[i]) ? "<array>" : SYMTAB[i] # else {printf("[%s]\t(%s)\n",i,SYMTAB[i]);}
    8     }
    9     printf("BEGIN-- after Symtab loop\n") > "/dev/stdout"   # never got here
   10 
   11     printf("BEGIN -- Functab is next\n") > "/dev/stdout"
   12     for (i in FUNCTAB) {
   13         printf "[%s] = %s\n", i, FUNCTAB[i] # else {printf("[%s]\t(%s)\n",i,FUNCTAB[i]);}
   14     }
   15     printf("BEGIN-- after Functab loop\n") > "/dev/stdout"  # never got here
   16     exit
   17 }
   18 
   19 function foo()
   20 {
   21     print "foo called"
   22 }
   23 
   24 function bar()
   25 {
   26     print "bar called"
   27 }
   28 
   29 # e-o-begin
   30 # --- No END, No Main ... ---