gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, egtests, updated. gawk-4.1.0-4276-gb051055


From: Arnold Robbins
Subject: [SCM] gawk branch, egtests, updated. gawk-4.1.0-4276-gb051055
Date: Sun, 25 Apr 2021 14:56:49 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, egtests has been updated
       via  b051055ae0662ca2e19d7b9a7eeb9f35aa75cb0e (commit)
      from  305706422354ffc2ccdce36ce8a10486f7b56af9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b051055ae0662ca2e19d7b9a7eeb9f35aa75cb0e

commit b051055ae0662ca2e19d7b9a7eeb9f35aa75cb0e
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Sun Apr 25 21:56:29 2021 +0300

    Initial add of tests for examples.

diff --git a/egtests/extracten b/egtests/extracten
new file mode 100755
index 0000000..8aafe69
--- /dev/null
+++ b/egtests/extracten
@@ -0,0 +1,14 @@
+:
+#set -xv
+
+echo "* Extracting in $s/en from the English gawktexi.in"
+cd $s
+# for existing directory, just replace the programs, leave what is there 
already
+from=$doclib
+if [ ! -d "en" ]
+then
+       mkdir en
+fi
+cd en
+cp $doclib/gawktexi.in gawktexi.in
+gawk -f $b/extracten.awk gawktexi.in
diff --git a/egtests/extracten.awk b/egtests/extracten.awk
new file mode 100755
index 0000000..986b09f
--- /dev/null
+++ b/egtests/extracten.awk
@@ -0,0 +1,89 @@
+# extract.awk --- extract files and run programs from Texinfo files
+#
+# Arnold Robbins, arnold@skeeve.com, Public Domain
+# May 1993
+# Revised September 2000
+
+BEGIN    { IGNORECASE = 1 }
+
+/^@c(omment)?[ \t]+system/ {
+    if (NF < 3) {
+        e = ("extract: " FILENAME ":" FNR)
+        e = (e  ": badly formed `system' line")
+        print e > "/dev/stderr"
+        next
+    }
+    $1 = ""
+    $2 = ""
+    stat = system($0)
+    if (stat != 0) {
+        e = ("extract: " FILENAME ":" FNR)
+        e = (e ": warning: system returned " stat)
+        print e > "/dev/stderr"
+    }
+}
+/^@c(omment)?[ \t]+file/ {
+    if (NF != 3) {
+        e = ("extract: " FILENAME ":" FNR ": badly formed `file' line")
+        print e > "/dev/stderr"
+        next
+    }
+    if ($3 != curfile) {
+        if (curfile != "")
+            filelist[curfile] = 1   # save to close later
+        curfile = $3
+    }
+
+    for (;;) {
+        if ((getline line) <= 0)
+            unexpected_eof()
+        if (line ~ /^@c(omment)?[ \t]+endfile/)
+            break
+        else if (line ~ /^@(end[ \t]+)?group/)
+            continue
+        else if (line ~ /^@c(omment+)?[ \t]+/)
+            continue
+        if (index(line, "@") == 0) {
+            print line > curfile
+            continue
+        }
+        n = split(line, a, "@")
+        # if a[1] == "", means leading @,
+        # don't add one back in.
+        for (i = 2; i <= n; i++) {
+            if (a[i] == "") { # was an @@
+                a[i] = "@"
+                if (a[i+1] == "")
+                    i++
+            }
+        }
+        print join(a, 1, n, SUBSEP) > curfile
+    }
+}
+END {
+    close(curfile)          # close the last one
+    for (f in filelist)     # close all the rest
+        close(f)
+}
+function unexpected_eof()
+{
+    printf("extract: %s:%d: unexpected EOF or error\n",
+                     FILENAME, FNR) > "/dev/stderr"
+    exit 1
+}
+# join.awk --- join an array into a string
+#
+# Arnold Robbins, arnold@skeeve.com, Public Domain
+# May 1993
+
+function join(array, start, end, sep,    result, i)
+{
+    if (sep == "")
+       sep = " "
+    else if (sep == SUBSEP) # magic value
+       sep = ""
+    result = array[start]
+    for (i = start + 1; i <= end; i++)
+        result = result sep array[i]
+    return result
+}
diff --git a/egtests/extractit b/egtests/extractit
new file mode 100755
index 0000000..1157004
--- /dev/null
+++ b/egtests/extractit
@@ -0,0 +1,14 @@
+:
+#set -xv
+
+echo "* extracting in $s/it from the Italian gawktexi.in"
+cd $s
+# for existing directory, just replace the programs, leave what is there 
already
+from=$doclib
+if [ ! -d "it" ]
+then
+       mkdir it
+fi
+cd it
+cp $doclib/gawktexi.in gawktexi.in
+gawk -f $b/extractit.awk gawktexi.in
diff --git a/egtests/extractit.awk b/egtests/extractit.awk
new file mode 100755
index 0000000..642c3c9
--- /dev/null
+++ b/egtests/extractit.awk
@@ -0,0 +1,109 @@
+# extract.awk --- estrae file ed esegue programmi dal file Texinfo
+#
+# Arnold Robbins, arnold@skeeve.com, Public Domain
+# May 1993
+# Revised September 2000
+
+BEGIN    { IGNORECASE = 1 }
+
+/^@c(omment)?[ \t]+system/ {
+    if (NF < 3) {
+        e = ("extract: " FILENAME ":" FNR)
+        e = (e  ": riga `system' con formato errato")
+        print e > "/dev/stderr"
+        next
+    }
+    $1 = ""
+    $2 = ""
+    stat = system($0)
+    if (stat != 0) {
+        e = ("extract: " FILENAME ":" FNR)
+        e = (e ": attenzione: system ha restituito " stat)
+        print e > "/dev/stderr"
+    }
+}
+/^@c(omment)?[ \t]+file/ {
+    if (NF != 3) {
+        e = ("extract: " FILENAME ":" FNR ": riga `file' con formato errato")
+        print e > "/dev/stderr"
+        next
+    }
+    if ($3 != file_corrente) {
+        if (file_corrente != "")
+            lista_file[file_corrente] = 1   # memorizza per chiudere dopo
+        file_corrente = $3
+    }
+
+    for (;;) {
+        if ((getline riga) <= 0)
+            fine_file_inattesa()
+        if (riga ~ /^@c(omment)?[ \t]+endfile/)
+            break
+        else if (riga ~ /^@(end[ \t]+)?group/)
+            continue
+        else if (riga ~ /^@c(omment+)?[ \t]+/)
+            continue
+        if (index(riga, "@") == 0) {
+            print riga > file_corrente
+            continue
+        }
+        # gestisci istruzioni che convertono caratteri accentati
+        if (index(riga, "gsub(\"@@") > 0) {
+            gsub("@{","{",riga)
+            gsub("@}","}",riga)
+            gsub("@@","@",riga)
+            print riga > file_corrente
+            continue
+        }
+        # istruzioni che convertono caratteri accentati
+        gsub("@`a","à",riga)
+        gsub("@`e","è",riga)
+        gsub("@'e","é",riga)
+        gsub("@`{@dotless{i}}","ì",riga)
+        gsub("@`o","ò",riga)
+        gsub("@`u","ù",riga)
+        # riga contiene ancora caratteri @?
+        if (index(riga, "@") == 0) {
+            print riga > file_corrente
+            continue
+        }
+        n = split(riga, a, "@")
+        # if a[1] == "", vuol dire riga che inizia per @,
+        # non salvare un @
+        for (i = 2; i <= n; i++) {
+            if (a[i] == "") { # era un @@
+                a[i] = "@"
+                if (a[i+1] == "")
+                    i++
+            }
+        }
+        print join(a, 1, n, SUBSEP) > file_corrente
+    }
+}
+END {
+    close(file_corrente)    # chiudi l'ultimo file
+    for (f in lista_file)   # chiudi tutti gli altri
+        close(f)
+}
+function fine_file_inattesa()
+{
+    printf("extract: %s:%d: fine-file inattesa, o errore\n",
+                     FILENAME, FNR) > "/dev/stderr"
+    exit 1
+}
+# join.awk --- trasforma un vettore in una stringa
+#
+# Arnold Robbins, arnold@skeeve.com, Public Domain
+# May 1993
+
+function join(vettore, iniz, fine, separ,    risultato, i)
+{
+    if (separ == "")
+       separ = " "
+    else if (separ == SUBSEP) # valore magico
+       separ = ""
+    risultato = vettore[iniz]
+    for (i = iniz + 1; i <= fine; i++)
+        risultato = risultato separ vettore[i]
+    return risultato
+}
diff --git a/egtests/gawkeg b/egtests/gawkeg
new file mode 100755
index 0000000..48465e2
--- /dev/null
+++ b/egtests/gawkeg
@@ -0,0 +1,864 @@
+:
+# / main
+# ...for customisation
+#
+print_help() {
+       echo "*"
+       echo "Choose by number one or more tests to try"
+       echo "e.g.: 1-5,14,26-30"
+       echo "If a suffix is given, e.g.: 1e or: h"
+       echo "alone or after the list of numbers"
+       echo "h -- will just print this help text"
+       echo "d -- will invoke ${vim}diff for a test file in both languages"
+       echo "b -- will invoke $vim for a test file"
+       echo "e -- will invoke $vim for a test file"
+       echo "w -- will tell where a module is"
+       echo "q,Q,quit,x,ZZ,zz -- will exit from gawkeg"
+       echo "Everything else just has no effect"
+}
+
+do_addresses() {
+       echo "*"
+       echo "* Tested by simple_csv"
+       do_simple_csv
+}
+
+do_alarm() {
+       echo "*"
+       now=`date "+%H:%M"`
+       echo "now   is $now"
+       # fails on 23:59
+       echo "*"
+       later=`date "+%H %M"|gawk ' { if ( $2 < 59 ) { 
printf("%2.2d:%2.2d",$1,$2+1); } else { printf("%2.2d",$1+1,0);} } '`
+       echo "later is $later"
+       echo "*"
+       echo "gawk -f alarm.awk -f gettime.awk $later \"testing alarm for 
$later\" 5 1"
+             gawk -f alarm.awk -f gettime.awk $later  "testing alarm for 
$later"  5 1
+}
+
+do_anagram() {
+       echo "*"
+       echo "gawk -f anagram.awk /usr/share/dict/words | grep '^com'"
+             gawk -f anagram.awk /usr/share/dict/words | grep '^com'
+}
+
+do_arraymax() {
+       echo "*"
+       echo "cat $miscdir/arraymax.data"
+             cat $miscdir/arraymax.data
+       echo "*"
+       echo "* in the output, the written numbers should be in order"
+       echo "*"
+       echo "gawk -f arraymax.awk $miscdir/arraymax.data"
+             gawk -f arraymax.awk $miscdir/arraymax.data
+}
+
+do_arraymax_data() {
+       echo "*"
+       echo "* Tested by arraymax.awk"
+       do_arraymax
+}
+
+do_assert() {
+       echo 'BEGIN {  for ( i=1; i<=4; i++ ) { a[i]=i ; b[i]=i } for ( i=1; 
i<=4; i++) { c=a[i] ; { for (j=4; j>=1; j-- ) { d=b[j] ; print "c = ",c,"d 
=",d;  assert(c<=d, "c<=d" ) } } } exit }' > $testpgm
+       echo "*"
+       echo "gawk -f $testpgm -f assert.awk"
+             gawk -f $testpgm -f assert.awk
+}
+
+do_awksed() {
+       echo "*"
+       echo "head -5 /etc/hosts"
+             head -5 /etc/hosts
+       echo "*"
+       echo "head -5 /etc/hosts|gawk -f awksed.awk 0 ZZZ"
+             head -5 /etc/hosts|gawk -f awksed.awk 0 ZZZ
+}
+
+do_bits2str() {
+       echo "*"
+       echo "* Tested by testbits.awk"
+       do_testbits
+}
+
+do_class_data1() {
+       echo "*"
+       echo "* Tested by indirectcall.awk"
+       do_indirectcall
+}
+
+do_class_data2() {
+       echo "*"
+       echo "* Tested by quicksort.awk"
+       do_quicksort
+}
+
+do_cliff_rand() {
+       echo 'BEGIN { for ( i=1; i<=10; i++ ) print cliff_rand() ; exit } ' > 
$testpgm
+       echo "*"
+       echo "gawk -f cliff_rand.awk -f $testpgm"
+             gawk -f cliff_rand.awk -f $testpgm
+}
+
+do_ctime() {
+       echo 'BEGIN { print ctime(); for ( i=1; i<=20000000; i++ ) a++; print 
"after " a " empty loops"; print ctime() } ' > $testpgm
+       echo "*"
+       echo "gawk -f $testpgm -f ctime.awk"
+             gawk -f $testpgm -f ctime.awk
+}
+
+do_cut() {
+       echo "*"
+       echo "echo abcdefghijklmnopqrstuwwxyz 0123456789 | gawk -f getopt.awk  
-f cut.awk -f join.awk -- -c2-8"
+             echo abcdefghijklmnopqrstuwwxyz 0123456789 | gawk -f getopt.awk  
-f cut.awk -f join.awk -- -c2-8
+       echo "*"
+       echo "echo abcdefghijklmnopqrstuwwxyz@0123456789 | gawk -f getopt.awk  
-f cut.awk -f join.awk -- -f2 -d@"
+             echo abcdefghijklmnopqrstuwwxyz@0123456789 | gawk -f getopt.awk  
-f cut.awk -f join.awk -- -f2 -d@
+       echo "*"
+       echo "echo abcdefghijklmnopqrstuwwxyz 0123456789 | gawk -f getopt.awk  
-f cut.awk -f join.awk -- -c24-32"
+             echo abcdefghijklmnopqrstuwwxyz 0123456789 | gawk -f getopt.awk  
-f cut.awk -f join.awk -- -c24-32
+}
+
+do_dupword() {
+       echo "*"
+       echo "echo \"a a a b c c c d e e e f g g h iii iii j kkk kkk\"|gawk -f 
dupword.awk"
+             echo  "a a a b c c c d e e e f g g h iii iii j kkk kkk" |gawk -f 
dupword.awk
+}
+
+do_egrep() {
+       echo "*"
+       echo "head -5 /etc/hosts"
+             head -5 /etc/hosts
+       echo "*"
+       echo "head -5 /etc/hosts|gawk -f getopt.awk -f egrep.awk -- 127"
+             head -5 /etc/hosts|gawk -f getopt.awk -f egrep.awk -- 127
+       echo "*"
+       echo "head -5 /etc/hosts|gawk -f getopt.awk -f egrep.awk -- -n 127"
+             head -5 /etc/hosts|gawk -f getopt.awk -f egrep.awk -- -n 127
+       echo "*"
+       echo "head -5 /etc/hosts|gawk -f getopt.awk -f egrep.awk -- -c 127"
+             head -5 /etc/hosts|gawk -f getopt.awk -f egrep.awk -- -c 127
+       echo "*"
+       echo "gawk -f getopt.awk -f egrep.awk -- IGNORECASE *.awk"
+             gawk -f getopt.awk -f egrep.awk -- IGNORECASE *.awk
+}
+
+do_extract() {
+       echo "*"
+       echo "* extract.awk is implicitly tested when running gawkeg:"
+       echo "* it is used to build the test libraries."
+       echo "* If there are problems they should be reported during"
+       echo "* the initialization of the gawkeg shell script"
+}
+
+do_findpat() {
+       echo "*"
+       echo "cat $miscdir/findpat.data"
+             cat $miscdir/findpat.data
+       echo "*"
+       echo "gawk -f findpat.awk $miscdir/findpat.data"
+             gawk -f findpat.awk $miscdir/findpat.data
+}
+
+do_findpat_data() {
+       echo "*"
+       echo "* Tested by findpat.awk"
+       do_findpat
+       return
+}
+
+do_ftrans() {
+       echo "*"
+       echo " FILENAME != _oldfilename_ && _filename_ != FILENAME { if 
(_oldfilename_ != \"\") endfile(_oldfilename_) ; _oldfilename_ = FILENAME ; 
beginfile(FILENAME) } function beginfile(filename){ print \"in beginfile for \" 
filename ; nin=0 } function endfile(filename){ print \"in endfile   for \" 
filename \" \" nin \" record\" } { nin++ } ">$testpgm
+       echo "gawk -f ftrans.awk -f $testpgm wc.awk cut.awk pi.awk"
+             gawk -f ftrans.awk -f $testpgm wc.awk cut.awk pi.awk
+}
+
+do_getopt() {
+       echo "*"
+       echo "gawk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x -y -zfoo"
+             gawk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x -y -zfoo
+}
+
+do_gettime() {
+       echo "*"
+       echo "* Tested by alarm.awk"
+       do_alarm
+}
+
+do_getlocaltime() {
+       echo "*"
+       echo "* Tested by alarm.awk"
+       echo "*"
+       echo "* getlocaltime routine is contained in gettime.awk"
+       do_alarm
+}
+
+do_grcat() {
+       echo "*"
+       echo "gcc -o $tmplib/grcat ../lib/grcat.c -DHAVE_GETGRENT"
+             gcc -o $tmplib/grcat ../lib/grcat.c -DHAVE_GETGRENT
+       echo "*"
+       echo "$tmplib/grcat|head"
+             $tmplib/grcat|head
+}
+
+do_groupawk() {
+       echo "*"
+       echo "* Tested by id"
+       do_id
+}
+
+do_guide() {
+       # the first time you really convert the messages
+       echo "*"
+       echo "gawk --gen-pot -f guide.awk >$datadir/guide.pot"
+             gawk --gen-pot -f guide.awk >$datadir/guide.pot 
+       echo "# if the file is not existing yet, save this file as 
$datadir/$poname.po" >>$datadir/guide.pot
+       echo "*"
+       echo "$vim $datadir/guide.pot"
+             wait_go_ahead
+             $vim $datadir/guide.pot
+       echo "*"
+       echo "*"
+       echo "msgfmt $datadir/$poname.po -o $podir/LC_MESSAGES/guide.mo"
+             msgfmt $datadir/$poname.po -o $podir/LC_MESSAGES/guide.mo
+       echo "*"
+       echo "* Translated messages:"
+       echo "gawk -f guide.awk"
+             gawk -f guide.awk
+       echo "*"
+       echo "* Original messages:"
+       echo "gawk --posix -f guide.awk -f libintl.awk"
+             gawk --posix -f guide.awk -f libintl.awk 
+}
+
+do_guide_po() {
+       echo "*"
+       echo "* Tested by guide"
+       do_guide
+}
+
+do_guide_mellow() {
+       echo "*"
+       echo "* Tested by guide"
+       do_guide
+}
+
+do_guide_pot() {
+       echo "*"
+       echo "* Tested by guide"
+       do_guide
+}
+
+do_have_mpfr() {
+       echo "*"
+       echo "BEGIN { fpbits = 123 ; PREC = fpbits ; if (! 
adequate_math_precision(fpbits)) { print \"Error: insufficient computation 
precision available.\"; print \"Try again with the -M argument?\"; exit 1 } 
else { print \"Computation precision should be enough.\"; exit } }" > $testpgm
+       echo "gawk -f have_mpfr.awk -f $testpgm"
+             gawk -f have_mpfr.awk -f $testpgm
+       echo "*"
+       echo "gawk -M -f have_mpfr.awk -f $testpgm"
+             gawk -M -f have_mpfr.awk -f $testpgm
+}
+
+do_histsort() {
+       echo "*"
+       # history has a line number before each entry
+       echo "history|tail -30|cut -c8-|gawk -f histsort.awk|sort"
+             history|tail -30|cut -c8-|gawk -f histsort.awk|sort
+}
+
+do_id() {
+       echo "*"
+       if [ ! -s "$tmplib/grcat" ]
+       then
+               echo "* compiling grcat"
+               echo "gcc -o $tmplib/grcat ../lib/grcat.c -DHAVE_GETGRENT"
+                     gcc -o $tmplib/grcat ../lib/grcat.c -DHAVE_GETGRENT
+       fi
+       echo "* state where grcat is and load group functions"
+       echo "gawk -v lib=$tmplib ' \$1==\"_gr_awklib\"  { print \$1,\$2,lib; 
next } { print } ' ../lib/groupawk.in > $testpgm"
+             gawk -v lib=$tmplib '   $1=="_gr_awklib"   { print $1 " " $2 " 
\"" lib "/\"";   next } { print } ' ../lib/groupawk.in > $testpgm
+       echo "*"
+       echo "gawk -f getopt.awk -f $testpgm -f passwdawk.in -f id.awk -- "
+             gawk -f getopt.awk -f $testpgm -f passwdawk.in -f id.awk --
+       echo "*"
+       echo "gawk -f getopt.awk -f $testpgm -f passwdawk.in -f id.awk -- -g"
+             gawk -f getopt.awk -f $testpgm -f passwdawk.in -f id.awk -- -g
+       echo "*"
+       echo "gawk -f getopt.awk -f $testpgm -f passwdawk.in -f id.awk -- -G"
+             gawk -f getopt.awk -f $testpgm -f passwdawk.in -f id.awk -- -G
+}
+
+do_igawk() {
+       echo "*"
+       echo "* testing using the cut.awk program (requires getopt and join)"
+       echo "*"
+       echo "echo \"@include getopt.awk\"  >$testpgm"
+             echo  "@include getopt.awk"   >$testpgm
+       echo "echo \"@include join.awk\"   >>$testpgm"
+             echo  "@include join.awk"    >>$testpgm
+       echo "cat cut.awk >> $testpgm"
+             cat cut.awk >> $testpgm
+       echo "*"
+       echo "echo abcdefghijklmnopqrstuwwxyz 0123456789 | igawk.sh -f $testpgm 
-- -c2-8"
+             echo abcdefghijklmnopqrstuwwxyz 0123456789 | igawk.sh -f $testpgm 
-- -c2-8
+}
+
+do_indirectcall() {
+       echo "*"
+       echo "gawk -f indirectcall.awk $datadir/class_data1"
+             gawk -f indirectcall.awk $datadir/class_data1
+}
+
+do_inplace() {
+       echo "*"
+       echo "echo \"one two three four\"|gawk -i inplace '{ gsub(/three/, "3") 
}; { print }'"
+       echo        "one two three four" |gawk -i inplace '{ gsub(/three/, "3") 
}; { print }'
+       echo "*"
+       echo "head -5 $datadir/mail-list > $testpgm"
+             head -5 $datadir/mail-list > $testpgm
+       echo "*"
+       echo "cat $testpgm"
+             cat $testpgm
+       echo "*"
+       echo "gawk -i inplace '{ gsub(/gmail/, \"ZZZZZ\") }; { gsub(\"555\", 
\"999\") } { print }' $testpgm"
+             gawk -i inplace '{ gsub(/gmail/,  "ZZZZZ" ) }; { gsub( "555",   
"999" ) } { print }' $testpgm
+       echo "*"
+       echo "cat $testpgm"
+             cat $testpgm
+}
+
+do_intdiv0() {
+       echo "*"
+       echo "BEGIN { intdiv0(123456789,45678,res); for ( i in res ) print 
i,res[i] ; print res[\"quotient\"]*45678+res[\"remainder\"] ; exit; }" >$testpgm
+       echo "cat $testpgm"
+             cat $testpgm
+       echo "gawk -f $testpgm -f intdiv0.awk"
+             gawk -f $testpgm -f intdiv0.awk
+}
+
+do_inventory_shipped() {
+       echo "*"
+       echo "* inventory-shipped is used as input to a few sample programs"
+       echo "*"
+       echo "gawk '\$1 ~ /J/ { print \$0 }' $datadir/inventory-shipped"
+             gawk ' $1 ~ /J/ { print  $0 }' $datadir/inventory-shipped
+       echo "*"
+}
+
+do_join() {
+       echo 'BEGIN {  for ( i=1; i<=9; i++ ) a[i]=i ; for ( i in a ) print 
a[i] ; print "* joining only from 2 to 8"; joined=join(a,2,8,"_|_"); print 
joined; exit; }' > $testpgm
+       echo "*"
+       echo "gawk -f $testpgm -f join.awk"
+             gawk -f $testpgm -f join.awk
+}
+
+do_labels() {
+       echo "*"
+       echo "BEGIN { for (i=1; i<=35; i++ ) { gen_label(); } exit; } function 
gen_label() { nlab++; printf \"Given-Name \"; for ( j=1; j<=8; j++ ) { printf 
nlab; } print \"\"; print \"Broad Street,\",nlab; print \"12345 Somewhere\"; 
print \"KY\"; print \"\"; }" >$testpgm
+       echo "* creating a \"label\" file"
+       echo "gawk -f \$testpgm >../../labels.txt"
+             gawk -f  $testpgm >../../labels.txt
+       echo "* calling the labels.awk program"
+       echo "gawk -f labels.awk ../../labels.txt >../../labels.out"
+             gawk -f labels.awk ../../labels.txt >../../labels.out
+       echo "* invoking $vim to view output of labels.awk"
+             wait_go_ahead
+             $vim -o ../../labels.txt ../../labels.out
+             rm -f   ../../labels.txt ../../labels.out
+
+}
+
+do_libintl() {
+       echo "*"
+       echo "* Tested by guide"
+       do_guide
+}
+
+do_mail_list() {
+       echo "*"
+       echo "* mail-list is used as input to a few sample programs"
+       echo "*"
+       echo "gawk '/li/ { print \$0 }' $datadir/mail-list"
+             gawk '/li/ { print  $0 }' $datadir/mail-list
+}
+
+do_noassign() {
+       echo "*"
+       echo "* preparing a test program"
+       echo "BEGIN { print \"==>\",a,b,c,\"<==\"; exit }"
+       echo "BEGIN { print \"==>\",a,b,c,\"<==\"; exit }" > $testpgm
+       echo "* no assignments"
+       echo "gawk -v No_command_assign=1 -v a=1 -v b=2 -v c=3 -f noassign.awk 
-f $testpgm"
+             gawk -v No_command_assign=1 -v a=1 -v b=2 -v c=3 -f noassign.awk 
-f $testpgm
+       echo "* use assignments"
+       echo "gawk -v No_command_assign=0 -v a=1 -v b=2 -v c=3 -f noassign.awk 
-f $testpgm"
+             gawk -v No_command_assign=0 -v a=1 -v b=2 -v c=3 -f noassign.awk 
-f $testpgm
+}
+
+do_ns_passwd() {
+       if [ ! -s "$tmplib/pwcat" ]
+       then
+               echo "* compiling pwcat"
+               echo "gcc -o $tmplib/pwcat ../lib/pwcat.c -DHAVE_GETGRENT"
+                     gcc -o $tmplib/pwcat ../lib/pwcat.c -DHAVE_GETGRENT
+       fi
+       echo "*"
+       echo "* state where pwcat is and load group functions"
+       echo "gawk -v lib=$tmplib ' \$1==\"Awklib\"  { print \$1,\$2,lib; next 
} { print } ' ../lib/passwdawk.in > $testpgm"
+             gawk -v lib=$tmplib '   $1=="Awklib"   { print $1 " " $2 " \"" 
lib "/\"";   next } { print } ' ../lib/passwdawk.in > $testpgm
+       echo "BEGIN { while ((p = getpwent()) != \"\") print p ; exit }" >> 
$testpgm
+       echo "gawk -f $testpgm|head"
+             gawk -f $testpgm|head
+}
+
+do_ord() {
+       echo "*"
+       echo "BEGIN { print \"hit ENTER to exit\"; for (;;) { printf(\"enter a 
character: \") ; if (getline var <= 0) break ; if ( var==\"\" ) break ; 
printf(\"ord(%s) = %d\n\", var, ord(var)) ; printf(\"chr(%d) = %s\n\", 
ord(var), chr(ord(var))) } exit }" >$testpgm
+       echo "gawk -f ord.awk -f $testpgm"
+             gawk -f ord.awk -f $testpgm
+}
+
+do_passwdawk() {
+       echo "*"
+       echo "* Tested by ns_passwd.awk"
+       do_ns_passwd
+}
+
+do_pi() {
+       echo "*"
+       echo "* just a few decimals for testing"
+       if [ "$lang" = "en" ]
+       then
+       echo "gawk ' \$1==\"digits\"  { print \$1,\$2,60; next } { print } ' 
pi.awk > $testpgm"
+             gawk '  $1=="digits"    { print $1,$2,60; next   } { print } ' 
pi.awk > $testpgm
+       fi
+       if [ "$lang" = "it" ]
+       then
+       echo "gawk ' \$1==\"cifre\"  { print \$1,\$2,60; next } { print } ' 
pi.awk > $testpgm"
+             gawk '  $1=="cifre"    { print $1,$2,60; next   } { print } ' 
pi.awk > $testpgm
+       fi
+       echo "gawk -M -v PREC=1000 -f intdiv0.awk  -f $testpgm"
+             gawk -M -v PREC=1000 -f intdiv0.awk  -f $testpgm
+       echo "3141592653589793238462643383279502884197169399375105820974944 
...from the Internet"
+}
+
+do_processarray() {
+       echo "*"
+       echo "* test array:"
+       echo "a[1] = 1"
+       echo "a[2][1] = 21"
+       echo "a[2][2] = 22"
+       echo "a[3] = 3"
+       echo "a[4][1][1] = 411"
+       echo "a[4][2] = 42"
+       echo "BEGIN { a[1] = 1; a[2][1] = 21; a[2][2] = 22; a[3] = 3; 
a[4][1][1] = 411; a[4][2] = 42; process_array(a, \"a\", \"do_print\", 0) } ; 
function do_print(name, element) { printf \"%s = %s\n\", name, element }" > 
$testpgm
+       echo "*"
+       echo "gawk -f processarray.awk -f $testpgm"
+             gawk -f processarray.awk -f $testpgm
+}
+
+do_pwcat() {
+       echo "*"
+       echo "gcc -o $tmplib/pwcat ../lib/pwcat.c -DHAVE_GETGRENT"
+             gcc -o $tmplib/pwcat ../lib/pwcat.c -DHAVE_GETGRENT
+       echo "*"
+       echo "$tmplib/pwcat|head"
+             $tmplib/pwcat|head
+}
+
+do_quicksort() {
+       echo "*"
+       echo "gawk -f quicksort.awk -f indirectcall.awk $datadir/class_data2"
+              gawk -f quicksort.awk -f indirectcall.awk $datadir/class_data2
+       return
+}
+
+do_readable() {
+       echo "*"
+       echo "BEGIN{ for ( i=1; i<ARGC; i++ ) { print i,ARGV[i]; } }" >$testpgm
+       echo "gawk -f readable.awk -f $testpgm /root/.vimrc $HOME/.vimrc 
/root/.netrc $HOME/.netrc"
+             gawk -f readable.awk -f $testpgm /root/.vimrc $HOME/.vimrc 
/root/.netrc $HOME/.netrc
+}
+
+do_readfile() {
+       echo "*"
+       echo "@load \"readfile\"; BEGIN { contents = readfile(\"/etc/hosts\"); 
if (contents == \"\" && ERRNO != \"\") { print(\"problem reading file\", ERRNO) 
> \"/dev/stderr\" } else { print length(contents) } }" > $testpgm
+       echo "* using as test file /etc/hosts"
+       echo "* its length in bytes is:"
+            wc -c /etc/hosts
+       echo "* running the test program:"
+            gawk -f $testpgm
+}
+
+do_rewind() {
+       echo "*"
+       echo "* test data"
+       echo "printf \"a\nb\nc\nd\ne\n\" > $testdata"
+             printf  "a\nb\nc\nd\ne\n"  > $testdata
+       echo "echo \"FNR == 3 && ! rewound { rewound = 1; rewind() } { print 
FILENAME, FNR, \$0 }\" >$testpgm"
+             echo  "FNR == 3 && ! rewound { rewound = 1; rewind() } { print 
FILENAME, FNR, \$0 }"  >$testpgm
+       echo "* It should restart after reaching c"
+       echo "gawk -f rewind.awk -f $testpgm $testdata"
+             gawk -f rewind.awk -f $testpgm $testdata
+}
+
+do_round() {
+       echo "*"
+       echo "* test data"
+       echo "printf \"0.5\n1.5\n2.5\n3.5\n4.5\n5.5\" > $testdata"
+             printf  "0.5\n1.5\n2.5\n3.5\n4.5\n5.5"  > $testdata
+             echo "echo  { print \$0, \"====>\", round(\$0); printf(\"regular: 
%2.1d\n\",\$0); }  > $testpgm"
+                   echo "{ print \$0, \"====>\", round(\$0); printf(\"regular: 
%2.1d\n\",\$0); }" > $testpgm
+       echo "gawk -f round.awk -f $testpgm $testdata"
+             gawk -f round.awk -f $testpgm $testdata
+}
+
+do_sample() {
+       echo "*"
+       echo "* Tested by test_csv"
+       do_test_csv
+}
+
+do_shellquote() {
+       echo "*"
+       echo "* test data"
+       echo "LANG=en_US.88591 metaflac --set-tag=TITLE='Whoope! That'\"'\"'s 
Great' file.flac" > $testdata
+       echo "cat $testdata"
+             cat $testdata
+       echo "{ RET=shell_quote(\$0); print RET; }" > $testpgm
+       echo "*"
+       echo "gawk -f shellquote.awk -f $testpgm $testdata"
+             gawk -f shellquote.awk -f $testpgm $testdata
+}
+
+do_simple_csv() {
+       echo "*"
+       echo "cat $miscdir/addresses.csv"
+             cat $miscdir/addresses.csv
+       echo "*"
+       echo "gawk -f simple-csv.awk $miscdir/addresses.csv"
+             gawk -f simple-csv.awk $miscdir/addresses.csv
+}
+
+do_split() {
+       echo "*"
+       echo " cleanup just in case"
+       echo " rm -f ../../gawkeg*"
+              rm -f ../../gawkeg*
+       echo "gawk -f getopt.awk -f split.awk -- -l 5 /etc/hosts ../../gawkeg"
+             gawk -f getopt.awk -f split.awk -- -l 5 /etc/hosts ../../gawkeg
+             wc -l ../../gawkeg*
+       echo "*"
+       echo " cleanup just in case"
+       echo " rm -f ../../gawkeg*"
+              rm -f ../../gawkeg*
+       echo "gawk -f getopt.awk -f split.awk -- -b 100 /etc/hosts ../../gawkeg"
+             gawk -f getopt.awk -f split.awk -- -b 100 /etc/hosts ../../gawkeg
+             wc -c ../../gawkeg*
+}
+
+do_strtonum() {
+       echo "*"
+       echo "* using test program"
+       echo "BEGIN { a[1] = \"25\"; a[2] = \".31\"; a[3] = \"0123\"; a[4] = 
\"0xdeadBEEF\"; a[5] = \"123.45\"; a[6] = \"1.e3\"; a[7] = \"1.32\"; a[8] = 
\"1.32E2\"; for (i = 1; i in a; i++) print a[i], strtonum(a[i]), 
mystrtonum(a[i]); exit}" >$testpgm
+       echo "gawk -f strtonum.awk -f $testpgm"
+             gawk -f strtonum.awk -f $testpgm
+       echo "*"
+       echo "* using gawk function"
+       echo "BEGIN { a[1] = \"25\"; a[2] = \".31\"; a[3] = \"0123\"; a[4] = 
\"0xdeadBEEF\"; a[5] = \"123.45\"; a[6] = \"1.e3\"; a[7] = \"1.32\"; a[8] = 
\"1.32E2\"; for (i = 1; i in a; i++) print a[i], strtonum(a[i]), 
strtonum(a[i]); exit}" >$testpgm
+       echo "gawk -f $testpgm"
+             gawk -f $testpgm
+}
+
+do_tee() {
+       echo "*"
+       echo "* on the screen"
+       echo "head -5 /etc/hosts|gawk -f tee.awk $testdata"
+             head -5 /etc/hosts|gawk -f tee.awk $testdata
+       echo "*"
+       echo "* on the file"
+       echo "cat $testdata"
+             cat $testdata
+}
+
+do_test_csv() {
+       echo "*"
+       echo "* test data"
+       printf  
"p,\"q,r\",s\np,\"q\"\"r\",s\np,\"q,\"\"r\",s\np,\"\",s\np,,s\n"   >$testdata
+       echo "cat $testdata"
+             cat $testdata
+       echo "*"
+       gawk -f test-csv.awk $testdata
+}
+
+do_testbits() {
+       echo "*"
+       echo "gawk ' $0 ~ \"BEGIN\" { print_it=1; } print_it==1 { print } ' 
testbits.awk"
+             gawk ' $0 ~  "BEGIN"  { print_it=1; } print_it==1 { print } ' 
testbits.awk
+       echo "*"
+       echo "gawk -f testbits.awk"
+             gawk -f testbits.awk
+       # ideally it should be:
+       #echo "gawk -f testbits.awk -f bits2str.awk"
+       #      gawk -f testbits.awk -f bits2str.awk
+}
+
+do_translate() {
+       echo "*"
+       echo "input:"
+             head -5 /etc/hosts
+       echo "head -5 /etc/hosts|gawk -f translate.awk 1 \"#\""
+       echo "*"
+       echo "output:"
+             head -5 /etc/hosts|gawk -f translate.awk 1 "#"
+}
+
+do_uniq() {
+       echo "*"
+       printf "a a\nb b\nb b\nc c\nc c\nc c\n" > $testdata
+       echo "* input file"
+             cat $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f join.awk -f uniq.awk -- $testdata"
+             gawk -f getopt.awk -f join.awk -f uniq.awk -- $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f join.awk -f uniq.awk -- -d $testdata"
+             gawk -f getopt.awk -f join.awk -f uniq.awk -- -d $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f join.awk -f uniq.awk -- -c $testdata"
+             gawk -f getopt.awk -f join.awk -f uniq.awk -- -c $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f join.awk -f uniq.awk -- -f 1 $testdata"
+             gawk -f getopt.awk -f join.awk -f uniq.awk -- -f 1 $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f join.awk -f uniq.awk -- -s 2 $testdata"
+             gawk -f getopt.awk -f join.awk -f uniq.awk -- -s 2 $testdata
+}
+
+do_walkarray() {
+       echo "*"
+       echo "* test array:"
+       echo "a[1] = 1"
+       echo "a[2][1] = 21"
+       echo "a[2][2] = 22"
+       echo "a[3] = 3"
+       echo "a[4][1][1] = 411"
+       echo "a[4][2] = 42"
+       echo "BEGIN { a[1] = 1; a[2][1] = 21; a[2][2] = 22; a[3] = 3; 
a[4][1][1] = 411; a[4][2] = 42; walk_array(a, \"a\") };" > $testpgm
+       echo "*"
+       echo "gawk -f walkarray.awk -f $testpgm"
+             gawk -f walkarray.awk -f $testpgm
+}
+
+do_wc() {
+       echo "*"
+       echo "gawk -f getopt.awk -f ftrans.awk -f wc.awk -- /etc/hosts"
+             gawk -f getopt.awk -f ftrans.awk -f wc.awk -- /etc/hosts
+       echo "*"
+       echo "* using a multibyte file"
+        echo ":set 
langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,Π
P,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,Î¥Y,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,Ï
…y,ζz" > $testdata
+       echo "*"
+       echo "cat $testdata"
+             cat $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f ftrans.awk -f wc.awk -- -c $testdata"
+             gawk -f getopt.awk -f ftrans.awk -f wc.awk -- -c $testdata
+       echo "*"
+       echo "gawk -f getopt.awk -f ftrans.awk -f wc.awk -- -m $testdata"
+             gawk -f getopt.awk -f ftrans.awk -f wc.awk -- -m $testdata
+}
+
+do_wordfreq() {
+       echo "*"
+       printf "a a\nb b\nb b\nc c\nc c\nc c\n" > $testdata
+       echo "* input file"
+             cat $testdata
+       echo "gawk -f wordfreq.awk $testdata|sort -k2nr"
+             gawk -f wordfreq.awk $testdata|sort -k2nr
+}
+
+do_zerofile() {
+       echo "*"
+       echo "function zerofile(file,number){ print \"ignoring file 
number\",number,\"which has length zero:\",file }" > $testpgm
+       echo "gawk -f $testpgm -f zerofile.awk /etc/hosts /dev/null /etc/hosts 
/dev/null /etc/hosts /dev/null"
+             gawk -f $testpgm -f zerofile.awk /etc/hosts /dev/null /etc/hosts 
/dev/null /etc/hosts /dev/null
+}
+
+wait_go_ahead() {
+       echo "*"
+       echo "* Hit ENTER to proceed..."
+       read nothing
+       if [ "$nothing" = "q" -o "$nothing" = "Q" -o "$nothing" = "zz" -o 
"$nothing" = "ZZ" -o "$nothing" = "quit" -o "$nothing" = "x" ]
+       then
+               go_away
+       fi
+}
+
+go_away() {
+       #echo exiting, as per request
+       if [ -f "$testpgm" ]
+       then
+               rm -f $testpgm
+       fi
+       if [ -f "$testdata" ]
+       then
+               rm -f $testdata
+       fi
+       # this one should always be there
+       rm -f ../../egidx.awk
+       # these could be there or not
+       rm -f ../../gawkeg*
+       figlet done
+       exit
+}
+
+# set -xv
+#
+# main
+#
+# this script tests gawk programs that are in the eg directory
+# needs gawkextlib-1.0.4
+# needs gawk-mbs-snapshot.tar
+#
+# editor to use
+export vim=vim
+# the programs etc are extracted inside this directory
+export s=$t
+if [ ! -d "$s" ]
+then
+       mkdir $s
+fi
+# scripts etc. are in this directory
+export b=$d/dat/bin
+# parms: it or en, defaults to en
+if [ "$1" = "it" ]
+then
+       export lang=it
+       export LANGUAGE=it_IT.UTF-8
+       export podir=it_IT.UTF-8
+       export poname=guide-it
+       export doclib=$d/cache/gawk/doc/it
+       . $b/extractit
+else
+       export lang=en
+       export LANGUAGE=C.UTF-8
+       export podir=C.UTF-8
+       export poname=guide-mellow
+       export doclib=$d/cache/gawk/doc
+       . $b/extracten
+fi
+# depending on the language...
+export AWKPATH=.:$s/$lang/eg/lib:$s/$lang/eg/misc:$s/$lang/eg/prog
+export AWKLIBPATH=.:/usr/local/lib/gawk
+export datadir=$s/$lang/eg/data
+export miscdir=$s/$lang/eg/misc
+# for testing po / pot -- used only for Italian
+cd $s
+cp $b/guide-it.po $lang/eg/data
+# name of directory where grcat and pwcat are
+export tmplib=$s/$lang
+# name of a temporary program needed sometimes
+export testpgm=$tmplib/testpgm.awk
+# name of a temporary program needed sometimes
+export testdata=$tmplib/testdata.txt
+# working directory during the test
+cd $s/$lang/eg/prog
+# check that the extract.awk pgm is equal to the one from gawktexi.in
+cat extract.awk     >$testpgm
+cat ../lib/join.awk>>$testpgm
+diff $testpgm $b/extract$lang.awk
+if [ "$?" -ne 0 ]
+then
+       echo "*"
+       echo "* Beware, the extract.awk program is not the same contained in 
gawktexi.in"
+       echo "*"
+fi
+
+cd $s/$lang/eg
+list=`find . -type f|gawk -f $b/gawkeg.awk -v lang=$lang|sort`
+cd $s/$lang/eg/prog
+
+while  [ true ]
+do
+       # the parameter for scegli is the number of columns
+       scelta=`$b/scegli $list 4`
+        sublst=`$b/extract 1 "$scelta"`
+       #echo $sublst
+        subcmd=`$b/extract 2 "$scelta"`
+       #echo $subcmd
+       # done with
+       if [ "$subcmd" = "q" -o "$subcmd" = "Q" -o "$subcmd" = "zz" -o 
"$subcmd" = "ZZ" -o "$subcmd" = "quit" -o "$subcmd" = "x" ]
+       then
+               go_away
+       fi
+       # browse/edit
+       if [ "$subcmd" = "b" -o "$subcmd" = "e" ]
+       then
+               #echo $sublst
+               for i in $sublst
+               do
+                       subrou=`echo $i|gawk -v t="true" -f ../../egidx.awk`
+                       basename=`basename $subrou`
+                       figlet $basename
+                       echo "*"
+                       echo "* Browsing/editing $i"
+                       $vim $subrou
+                       wait_go_ahead
+               done
+               continue
+       fi
+       # vimdiff
+       if [ "$subcmd" = "d" -a "$sublst" != "" ]
+       then
+               #echo $sublst
+               for i in $sublst
+               do
+                       subrou=`echo $i|gawk -v t="true" -f ../../egidx.awk`
+                       figlet $subrou
+                       echo "*"
+                       echo "* viewing differences in $i"
+                       echo "*"
+                       other=`echo $i|gawk -v t="alte" -f ../../egidx.awk`
+                       echo $subrou $other
+                       ${vim}diff -c ":color blue" $subrou $other
+                       wait_go_ahead
+               done
+               continue
+       fi
+       # where is the program
+       if [ "$subcmd" = "w" -a "$sublst" != "" ]
+       then
+               for i in $sublst
+               do
+                       echo $i is:
+                       echo $i|gawk -v t="true" -f ../../egidx.awk
+                       echo $i|gawk -v t="alte" -f ../../egidx.awk
+               done
+               wait_go_ahead
+               continue
+       fi
+       if [ "$subcmd" = "h" -a "$sublst" == "" ]
+       then
+               print_help
+               wait_go_ahead
+               continue
+       fi
+       if [ "$subcmd" != "" ]
+       then
+               continue
+       fi
+       # every other $subcmd does nothing
+       #echo $sublst
+       for i in $sublst
+       do
+               subrou=`echo $i|cut -f 1 -d"."`
+               figlet $subrou
+               echo "*"
+               echo "* Testing $i"
+               do_$subrou
+               wait_go_ahead
+       done
+done
+
diff --git a/egtests/gawkeg.awk b/egtests/gawkeg.awk
new file mode 100755
index 0000000..79ec842
--- /dev/null
+++ b/egtests/gawkeg.awk
@@ -0,0 +1,40 @@
+# input is the output of a "find"
+# output is the list of stuff to test
+# secondary output is another gawk program that tells the real name behind the 
"short" filename
+# lang can be "en" or "it"
+BEGIN {
+       egi="../egidx.awk"
+       if ( lang=="en" ) { altl="it" }
+       if ( lang=="it" ) { altl="en" }
+       print "BEGIN { do_init() }" >egi
+       print " t==\"true\" { print true[$0]; exit }" >egi
+       print " t==\"alte\" { print alte[$0]; exit }" >egi
+       print "function do_init() {" >egi
+
+}
+
+END { print "}" >egi }
+
+{      wrk=$0
+       if ( wrk ~ ".un~"      ) { next }
+       if ( wrk ~ ".swp"      ) { next }
+       if ( wrk ~ ".swo"      ) { next }
+       if ( wrk ~ "guide-it"  ) { next }
+       nel=split(wrk,el,"/")
+       if ( nel!=3 ) { next }
+       gsub(".data","_data",el[3])
+       gsub("-","_",el[3])
+       print el[3];
+       if ( el[2]=="prog" ) {
+               print "true[\"" el[3] "\"]=\"" el[3] "\"" >egi
+               print "alte[\"" el[3] "\"]=\"../../../" altl "/eg/prog/" el[3] 
"\"" >egi
+       } else {
+               print "true[\"" el[3] "\"]=\"." $0    "\"" >egi
+               print "alte[\"" el[3] "\"]=\"../../../" altl "/eg/" el[2] "/" 
el[3] "\"" >egi
+       }
+       if ( el[3]=="gettime.awk" ) {
+               print "getlocaltime"
+               print "true[\"getlocaltime\"]=\"." $0    "\"" >egi;
+               print "alte[\"getlocaltime\"]=\"../../../" altl "/eg/" el[2] 
"/" el[3] "\"" >egi
+       }
+}
diff --git a/egtests/guide-it.po b/egtests/guide-it.po
new file mode 100644
index 0000000..a807818
--- /dev/null
+++ b/egtests/guide-it.po
@@ -0,0 +1,8 @@
+#: guide.awk:4
+msgid "Don't Panic"
+msgstr "Non v'allarmate"
+
+#: guide.awk:5
+msgid "The Answer Is"
+msgstr "La risposta è"
+
diff --git a/egtests/info.html b/egtests/info.html
new file mode 100644
index 0000000..2c8ba84
--- /dev/null
+++ b/egtests/info.html
@@ -0,0 +1,3 @@
+<div dir="ltr"><div class="gmail_default" 
style="font-family:monospace,monospace;font-size:large">Hi Arnold,<br><br>I 
just pushed an update to the Italian &quot;<a 
href="http://gawktexi.in";>gawktexi.in</a>&quot;.<br>Please, 
&quot;propagate&quot; it.<br><br>I have packed in a ZIP file all the scripts 
used<br>to test all the 66 examples/files that can be<br>extracted from the 
Gawk book.<br><br>To use it you should unzip the file in a 
test<br>&quot;bin&quot; directory, and change a few variables inside<br>the 
&quot;gawkeg&quot; script.<br><br>At the beginning of the &quot;gawkeg&quot; 
script there is<br>an indication of where are the variables to be<br>changed, 
basically the name of the test &quot;bin&quot;<br>directory where the script 
are ($b) the name of<br>where to put the &quot;eg&quot; directory ($s) and the 
names<br>of the directories where the &quot;<a 
href="http://gawktexi.in";>gawktexi.in</a>&quot; file<br>can be 
found.<br><br>Hopefully that should be enough.<br><br>Just run:<
 br>./gawkeg<br>...which defaults to &quot;en&quot;<br><br>or<br><br>./gawkeg 
it<br><br>To see all what can be done, at the &quot;gawkeg&quot;<br>prompt just 
type:<br><br>h&lt;ENTER&gt;<br><br>...for the &quot;d&quot; option (differences 
between English<br>and Italian script) to work, the &quot;other&quot; 
directory<br>must exist.<br><br>I tried to run the thing on another PC 
(under<br>WSL), from the &quot;distribution&quot; and changing the<br>test 
directories, and it seems to work.<br><br>Better not to use it with the 
&quot;root&quot; user, some<br>tests would give different results (e.g. 
the<br>&quot;readable&quot; one).<br><br>The script uses a couple of programs, 
&quot;scegli&quot; and<br>&quot;extract&quot;, of which only the executables 
are in the<br>ZIP file. If it is of interest, you can have the C<br>source 
files, but they are a mess: the two<br>programs have been written for a 
different set of<br>tasks, and should be rewritten, but since 
they<br>work...<br><br>The English 
 tests should all run fine. The Italian<br>ones do run here, but only with the 
just updated<br>Italian &quot;<a 
href="http://gawktexi.in";>gawktexi.in</a>&quot;.<br><br>Please let me know if 
you are able to use the<br>script, and if you have remarks, questions, 
etc.,<br>they are welcome.<br><br>All the best, Antonio<br><br>PS I did not 
bother to put licenses, but<br>everything can be used/modified freely, 
consider<br>it with the same license as gawk.</div><div class="gmail_default" 
style="font-family:monospace,monospace;font-size:large">-- <br><div dir="ltr" 
class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div 
dir="ltr"><div><div dir="ltr"><div><font size="4" face="monospace, monospace"> 
  /||\    | Antonio Colombo</font></div><font size="4" face="monospace, 
monospace">  / || \   |  <a href="mailto:azc100@gmail.com"; 
target="_blank">azc100@gmail.com</a>  </font><div><font size="4" 
face="monospace, monospace"> /  ()  \  | <a href="mailto:antonio@geekcorp.
 com" target="_blank">antonio@geekcorp.com</a>  <br>(___||___) |   <a 
href="mailto:azc10@yahoo.com"; 
target="_blank">azc10@yahoo.com</a></font></div></div></div></div></div></div></div></div></div><br>==================<br><br>Looking
 into the example programs, I wonder:<br><br>Should gettime.awk be renamed 
getlocaltime.awk<br>(or viceversa)? When checking alarm.awk, it<br>speaks of 
getlocaltime, but then you have<br>to use &quot;gettime.awk&quot; 
instead.<br><br>A few other gawk scripts have names slightly<br>different from 
the name in the &quot;eg/whatever&quot;<br>directory.<br><br>bits2str.awk is 
actually also contained in<br>testbits.awk, contrary to the philosophy 
of<br>the &quot;modularity&quot;. testbits.awk should not<br>contain it (I 
think). And the bits2str.awk<br>instructions are contained twice in <a 
href="http://gawktexi.in";>gawktexi.in</a>,<br>once for themselves, and once in 
testbits.awk.<br>I wonder if something should be changed here.<br><br>To get 
the test for c
 ut.awk working, I had to<br>put &quot;-f getopt.awk&quot; BEFORE &quot;-f 
cut.awk&quot;, not really<br>sure why. I wonder if it should be 
noted<br>somewhere. It is the case also for other &quot;users&quot;<br>of 
&quot;getopt&quot;.<br><br>The transfile.awk example is not extracted.<br>I 
wonder if it should or not...<br>To make the example work, I had to change in 
transfile.awk<br>FILENAME != _oldfilename @{<br>to<br>FILENAME != _oldfilename 
&amp;&amp; _filename_ != FILENAME @{<br>..or beginfile() would be invoked more 
than necessary<br><br>On a detail, for consistency with 
_filename_,<br>_oldfilename should be 
called<br>_oldfilename_<br><br>histsort.awk should be changed to use the 
input<br>records only AFTER the initial number,<br>otherwise all entries are 
different by definition.<br>I found no way to get history without the 
number<br>of the command, so I just cut it out for the 
test.<br><br>noassign.awk does not work (at least for me).<br>ARGC and ARGV 
give you only the input file
 s,<br>not the real ARGC and ARGV passed by the Operating<br>System to 
gawk.<br>Variables are not seen at all, so they are always<br>used inside the 
program (unless I missed something).<br>If one acts on 
PROCINFO[&quot;argc&quot;] and PROCINFO[&quot;argv&quot;],<br>one sees 
&quot;everything&quot;, as evidenced modifying noassign.awk<br>BEGIN {<br>    
if (No_command_assign) {<br>        for ( j in PROCINFO[&quot;argv&quot;] ) 
{ print &quot;#&quot;,j,PROCINFO[&quot;argv&quot;][j],&quot;#&quot;; }<br>    
    disable_assigns(ARGC, ARGV)<br>    }<br>}<br>I suspect the real ARGC 
and ARGV would not be changed.<br>Also, noassign.awk does not do anything about 
the &quot;-v&quot;<br>before the assignment. I wonder what to 
do.<br><br>ord.awk is ok, but it does not manage ASCII above 127<br>(European 
accented letter, e.g.). Not sure if it should<br>be modified.<br><br>In pi.awk 
it should be noted inside the program that<br>it needs intdiv0.awk (as it is 
noted in the text).<br><br>pro
 cess_array.awk is in processarray.awk:<br>maybe the name should be the 
same.<br><br>I am not sure that the output of shell_quote is OK<br>(too many 
&quot;&#39;&quot;s and 
&quot;&quot;&quot;s).<br><br>========================<br><br>In the last update 
to gawktexi,in, where you explain &quot;ls&quot;,<br>an &quot;old&quot; file 
should probably be present, to show the<br>difference in field 8, when the last 
modification<br>date goes back to 6 months or more:<br>-rwxrwxr-x 1 azc10 azc10 
  1427 apr 19 16:56 gawkdiff<br>-rwxrwxr-x 1 azc10 azc10    381 apr 13  
2020 fs_set.awk<br>...&quot;apr&quot; is in Italian, &quot;Jun&quot; would be 
&quot;giu&quot;<br><br>========================</div></div>
+
+--00000000000066ee9105b19e7629--
\ No newline at end of file
diff --git a/egtests/info.txt b/egtests/info.txt
new file mode 100644
index 0000000..dc735f5
--- /dev/null
+++ b/egtests/info.txt
@@ -0,0 +1,163 @@
+Hi Arnold,
+
+I just pushed an update to the Italian "gawktexi.in".
+Please, "propagate" it.
+
+I have packed in a ZIP file all the scripts used
+to test all the 66 examples/files that can be
+extracted from the Gawk book.
+
+To use it you should unzip the file in a test
+"bin" directory, and change a few variables inside
+the "gawkeg" script.
+
+At the beginning of the "gawkeg" script there is
+an indication of where are the variables to be
+changed, basically the name of the test "bin"
+directory where the script are ($b) the name of
+where to put the "eg" directory ($s) and the names
+of the directories where the "gawktexi.in" file
+can be found.
+
+Hopefully that should be enough.
+
+Just run:
+./gawkeg
+...which defaults to "en"
+
+or
+
+./gawkeg it
+
+To see all what can be done, at the "gawkeg"
+prompt just type:
+
+h<ENTER>
+
+...for the "d" option (differences between English
+and Italian script) to work, the "other" directory
+must exist.
+
+I tried to run the thing on another PC (under
+WSL), from the "distribution" and changing the
+test directories, and it seems to work.
+
+Better not to use it with the "root" user, some
+tests would give different results (e.g. the
+"readable" one).
+
+The script uses a couple of programs, "scegli" and
+"extract", of which only the executables are in the
+ZIP file. If it is of interest, you can have the C
+source files, but they are a mess: the two
+programs have been written for a different set of
+tasks, and should be rewritten, but since they
+work...
+
+The English tests should all run fine. The Italian
+ones do run here, but only with the just updated
+Italian "gawktexi.in".
+
+Please let me know if you are able to use the
+script, and if you have remarks, questions, etc.,
+they are welcome.
+
+All the best, Antonio
+
+PS I did not bother to put licenses, but
+everything can be used/modified freely, consider
+it with the same license as gawk.
+-- 
+   /||\    | Antonio Colombo
+  / || \   |  azc100@gmail.com
+ /  ()  \  | antonio@geekcorp.com
+(___||___) |   azc10@yahoo.com
+
+==================
+
+Looking into the example programs, I wonder:
+
+Should gettime.awk be renamed getlocaltime.awk
+(or viceversa)? When checking alarm.awk, it
+speaks of getlocaltime, but then you have
+to use "gettime.awk" instead.
+
+A few other gawk scripts have names slightly
+different from the name in the "eg/whatever"
+directory.
+
+bits2str.awk is actually also contained in
+testbits.awk, contrary to the philosophy of
+the "modularity". testbits.awk should not
+contain it (I think). And the bits2str.awk
+instructions are contained twice in gawktexi.in,
+once for themselves, and once in testbits.awk.
+I wonder if something should be changed here.
+
+To get the test for cut.awk working, I had to
+put "-f getopt.awk" BEFORE "-f cut.awk", not really
+sure why. I wonder if it should be noted
+somewhere. It is the case also for other "users"
+of "getopt".
+
+The transfile.awk example is not extracted.
+I wonder if it should or not...
+To make the example work, I had to change in transfile.awk
+FILENAME != _oldfilename @{
+to
+FILENAME != _oldfilename && _filename_ != FILENAME @{
+..or beginfile() would be invoked more than necessary
+
+On a detail, for consistency with _filename_,
+_oldfilename should be called
+_oldfilename_
+
+histsort.awk should be changed to use the input
+records only AFTER the initial number,
+otherwise all entries are different by definition.
+I found no way to get history without the number
+of the command, so I just cut it out for the test.
+
+noassign.awk does not work (at least for me).
+ARGC and ARGV give you only the input files,
+not the real ARGC and ARGV passed by the Operating
+System to gawk.
+Variables are not seen at all, so they are always
+used inside the program (unless I missed something).
+If one acts on PROCINFO["argc"] and PROCINFO["argv"],
+one sees "everything", as evidenced modifying noassign.awk
+BEGIN {
+    if (No_command_assign) {
+        for ( j in PROCINFO["argv"] ) { print
+"#",j,PROCINFO["argv"][j],"#"; }
+        disable_assigns(ARGC, ARGV)
+    }
+}
+I suspect the real ARGC and ARGV would not be changed.
+Also, noassign.awk does not do anything about the "-v"
+before the assignment. I wonder what to do.
+
+ord.awk is ok, but it does not manage ASCII above 127
+(European accented letter, e.g.). Not sure if it should
+be modified.
+
+In pi.awk it should be noted inside the program that
+it needs intdiv0.awk (as it is noted in the text).
+
+process_array.awk is in processarray.awk:
+maybe the name should be the same.
+
+I am not sure that the output of shell_quote is OK
+(too many "'"s and """s).
+
+========================
+
+In the last update to gawktexi,in, where you explain "ls",
+an "old" file should probably be present, to show the
+difference in field 8, when the last modification
+date goes back to 6 months or more:
+-rwxrwxr-x 1 azc10 azc10   1427 apr 19 16:56 gawkdiff
+-rwxrwxr-x 1 azc10 azc10    381 apr 13  2020 fs_set.awk
+..."apr" is in Italian, "Jun" would be "giu"
+
+========================

-----------------------------------------------------------------------

Summary of changes:
 egtests/extracten                              |  14 +
 awklib/extract.awk => egtests/extracten.awk    |   5 +-
 egtests/extractit                              |  14 +
 egtests/extractit.awk                          | 109 ++++
 egtests/gawkeg                                 | 864 +++++++++++++++++++++++++
 egtests/gawkeg.awk                             |  40 ++
 awklib/eg/data/guide.po => egtests/guide-it.po |   4 +-
 egtests/info.html                              |   3 +
 egtests/info.txt                               | 163 +++++
 9 files changed, 1211 insertions(+), 5 deletions(-)
 create mode 100755 egtests/extracten
 copy awklib/extract.awk => egtests/extracten.awk (95%)
 mode change 100644 => 100755
 create mode 100755 egtests/extractit
 create mode 100755 egtests/extractit.awk
 create mode 100755 egtests/gawkeg
 create mode 100755 egtests/gawkeg.awk
 copy awklib/eg/data/guide.po => egtests/guide-it.po (60%)
 create mode 100644 egtests/info.html
 create mode 100644 egtests/info.txt


hooks/post-receive
-- 
gawk



reply via email to

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