beebe/0000755000175000017500000000000013337176337011455 5ustar arnoldarnoldbeebe/procinfs.awk0000644000175000017500000000037606614711633014004 0ustar arnoldarnoldBEGIN { printf "Initially, PROCINFO[\"FS\"] = %s\n", PROCINFO["FS"] FIELDWIDTHS = "3 4 5 6" printf "After assign to FIELDWIDTHS, PROCINFO[\"FS\"] = %s\n", PROCINFO["FS"] FS = FS printf "After assign to FS, PROCINFO[\"FS\"] = %s\n", PROCINFO["FS"] } beebe/substr.ok0000644000175000017500000000007306345314777013335 0ustar arnoldarnoldA ab bc ab ab ef beebe/asgext.awk0000644000175000017500000000003605461100540013431 0ustar arnoldarnold{ print $3; $4 = "a"; print } beebe/arrayref.awk0000644000175000017500000000030605461100537013757 0ustar arnoldarnold BEGIN { # foo[10] = 0 # put this line in and it will work test(foo); print foo[1] test2(foo2); print foo2[1] } function test(foo) { test2(foo) } function test2(bar) { bar[1] = 1 } beebe/gsubasgn.awk0000644000175000017500000000045606254152100013755 0ustar arnoldarnold# tests for assigning to a function within that function #1 - should be bad function test1 (r) { gsub(r, "x", test1) } BEGIN { test1("") } #2 - should be bad function test2 () { gsub(/a/, "x", test2) } BEGIN { test2() } #3 - should be ok function test3 (r) { gsub(/a/, "x", r) } BEGIN { test3("") } beebe/regtest0000755000175000017500000000041105461100535013036 0ustar arnoldarnold#! /bin/sh case "$AWK" in "") AWK=../gawk ;; esac #AWK=${AWK:-../gawk} for i in reg/*.awk do it=`basename $i .awk` $AWK -f $i reg/$it.out 2>&1 if cmp -s reg/$it.out reg/$it.good then rm -f reg/$it.out else echo "regtest: $it fails" fi done beebe/gensub.in0000644000175000017500000000004406013750620013250 0ustar arnoldarnolda b c a b c a b c a b c a b c a b c beebe/prdupval.awk0000644000175000017500000000003506345314772014012 0ustar arnoldarnold{ print NF, $NF, "abc" $NF } beebe/inftest.awk0000644000175000017500000000014505461100537013621 0ustar arnoldarnoldBEGIN { x = 100 do { y = x ; x *= 1000; print x,y } while ( y != x ) print "loop terminated" } beebe/intest.awk0000644000175000017500000000013706345314763013466 0ustar arnoldarnoldBEGIN { bool = ((b = 1) in c); print bool, b # gawk-3.0.1 prints "0 "; should print "0 1" } beebe/pipeio1.awk0000644000175000017500000000233406345314770013525 0ustar arnoldarnold# From dragon!gamgee.acad.emich.edu!dhw Tue Mar 18 01:12:15 1997 # Return-Path: # Message-ID: # Date: Mon, 17 Mar 97 20:48 CST # From: dhw@gamgee.acad.emich.edu (David H. West) # To: arnold@gnu.ai.mit.edu # Subject: gawk 3.0.2 bug report (cc of msg to bug-gnu-utils) # Status: OR # Content-Length: 869 # X-Lines: 20 # X-Display-Position: 2 # # Nature of bug: operation on a pipe side-effects a different pipe. # Observed-With: gawk 3.0.2, Linux kernel 2.0.28 # Reproduce-By: running the following script, without and with the "close" # statement uncommented. # -----------------cut here-------------------------- BEGIN {FILE1="test1"; FILE2="test2"; print "1\n" > FILE1; close(FILE1); print "2\n" > FILE2; close(FILE2); cmd1="cat " FILE1; cmd2="cat " FILE2; #end of preparing commands which give easily-predictable output while( (cmd1 | getline)==1) { #terminates as file has only 1 line #and we never close cmd1 cmd2 | getline L; #BUG: uncommenting the following line causes an infinite loop close(cmd2); print $0,L; } } beebe/poundbang0000755000175000017500000000014505704066333013351 0ustar arnoldarnold#! /tmp/gawk -f { ccount += length($0) } END { printf "average line length is %2.4f\n", ccount/NR} beebe/manpage0000644000175000017500000001005605461100536012775 0ustar arnoldarnold.ds PX \s-1POSIX\s+1 .ds UX \s-1UNIX\s+1 .ds AN \s-1ANSI\s+1 .TH GAWK 1 "May 28 1991" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS .B gawk [ .B \-W .I gawk-options ] [ .BI \-F\^ fs ] [ .B \-v .IR var = val ] .B \-f .I program-file [ .B \-\^\- ] file .\^.\^. .br .B gawk [ .B \-W .I gawk-options ] [ .BI \-F\^ fs ] [ .B \-v .IR var = val ] [ .B \-\^\- ] .I program-text file .\^.\^. .SH DESCRIPTION .I Gawk is the GNU Project's implementation of the AWK programming language. It conforms to the definition of the language in the \*(PX 1003.2 Command Language And Utilities Standard (draft 11). This version in turn is based on the description in .IR "The AWK Programming Language" , by Aho, Kernighan, and Weinberger, with the additional features defined in the System V Release 4 version of \*(UX .IR awk . .I Gawk also provides some GNU-specific extensions. .PP The command line consists of options to .I gawk itself, the AWK program text (if not supplied via the .B \-f option), and values to be made available in the .B ARGC and .B ARGV pre-defined AWK variables. .SH OPTIONS .PP .I Gawk accepts the following options, which should be available on any implementation of the AWK language. .TP .BI \-F fs Use .I fs for the input field separator (the value of the .B FS predefined variable). .TP \fB\-v\fI var\fR\^=\^\fIval\fR Assign the value .IR val , to the variable .IR var , before execution of the program begins. Such variable values are available to the .B BEGIN block of an AWK program. .TP .BI \-f " program-file" Read the AWK program source from the file .IR program-file , instead of from the first command line argument. Multiple .B \-f options may be used. .TP .B \-\^\- Signal the end of options. This is useful to allow further arguments to the AWK program itself to start with a ``\-''. This is mainly for consistency with the argument parsing convention used by most other \*(PX programs. .PP Following the \*(PX standard, .IR gawk -specific options are supplied via arguments to the .B \-W option. Multiple .B \-W options may be supplied, or multiple arguments may be supplied together if they are separated by commas, or enclosed in quotes and separated by white space. Case is ignored in arguments to the .B \-W option. .PP The .B \-W option accepts the following arguments: .TP \w'\fBcopyright\fR'u+1n .B compat Run in .I compatibility mode. In compatibility mode, .I gawk behaves identically to \*(UX .IR awk ; none of the GNU-specific extensions are recognized. .TP .PD 0 .B copyleft .TP .PD .B copyright Print the short version of the GNU copyright information message on the error output. .TP .B lint Provide warnings about constructs that are dubious or non-portable to other AWK implementations. .TP .B posix This turns on .I compatibility mode, with the following additional restrictions: .RS .TP \w'\(bu'u+1n \(bu .B \ex escape sequences are not recognized. .TP \(bu The synonym .B func for the keyword .B function is not recognized. .TP \(bu The operators .B ** and .B **= cannot be used in place of .B ^ and .BR ^= . .RE .TP .B version Print version information for this particular copy of .I gawk on the error output. This is useful mainly for knowing if the current copy of .I gawk on your system is up to date with respect to whatever the Free Software Foundation is distributing. .PP Any other options are flagged as illegal, but are otherwise ignored. .SH AWK PROGRAM EXECUTION .PP An AWK program consists of a sequence of pattern-action statements and optional function definitions. .RS .PP \fIpattern\fB { \fIaction statements\fB }\fR .br \fBfunction \fIname\fB(\fIparameter list\fB) { \fIstatements\fB }\fR .RE .PP .I Gawk first reads the program source from the .IR program-file (s) if specified, or from the first non-option argument on the command line. The .B \-f option may be used multiple times on the command line. .I Gawk will read the program text as if all the .IR program-file s had been concatenated together. This is useful for building libraries of AWK functions, without having to include them in each new AWK beebe/dynlj.awk0000644000175000017500000000005406254152071013265 0ustar arnoldarnoldBEGIN { printf "%*sworld\n", -20, "hello" } beebe/reindops.in0000644000175000017500000000001406254152105013606 0ustar arnoldarnold+44 123 456 beebe/swaplns.awk0000644000175000017500000000010205461100536013624 0ustar arnoldarnold{ if ((getline tmp) > 0) { print tmp print } else print } beebe/argtest.ok0000644000175000017500000000006705465440571013461 0ustar arnoldarnoldARGV[0] = gawk ARGV[1] = -x ARGV[2] = -y ARGV[3] = abc beebe/prtoeval.awk0000644000175000017500000000017306254152104014000 0ustar arnoldarnoldfunction returns_a_str() { print "" ; return "'A STRING'" } BEGIN { print "partial line:", returns_a_str() } beebe/defref.ok0000644000175000017500000000017306057341224013232 0ustar arnoldarnoldgawk: defref.awk:2: warning: function `foo' called but never defined gawk: defref.awk:1: fatal: function `foo' not defined beebe/prmarscl.ok0000644000175000017500000000011506444560346013626 0ustar arnoldarnoldgawk: prmarscl.awk:4: fatal: attempt to use scalar parameter `a' as an array beebe/fstabplus.awk0000644000175000017500000000006005461100536014143 0ustar arnoldarnoldBEGIN { FS = "\t+" } { print $1, $2 } beebe/getlnhd.awk0000644000175000017500000000040206254152100013560 0ustar arnoldarnoldBEGIN { pipe = "cat < 0) print exit 0 } beebe/numsubstr.ok0000644000175000017500000000001506033642606014036 0ustar arnoldarnold000 1000 000 beebe/reindops.awk0000644000175000017500000000011706254152105013766 0ustar arnoldarnold{ if ($1 !~ /^+[2-9]/) print "gawk is broken" else print "gawk is ok" } beebe/rs.in0000644000175000017500000000002505461100536012411 0ustar arnoldarnold a b c d e beebe/swaplns.ok0000644000175000017500000000054705461100535013467 0ustar arnoldarnoldfeatures of gawk - mostly not present in an old awk. Some are from This directory contains some examples/test-cases for different Read header comments before attempting to use. Have fun and remember "The GAWK Manual", some are original, and some are mixture of the two. file. that program which consists only of BEGIN block does not need an input --mj beebe/fnarydel.awk0000644000175000017500000000135506345314761013765 0ustar arnoldarnold#!/usr/local/bin/gawk -f BEGIN { process() } function process(aa,a) { delete aa } BEGIN { for (i = 1; i < 10; i++) a[i] = i; print "first loop" for (i in a) print a[i] delete a print "second loop" for (i in a) print a[i] for (i = 1; i < 10; i++) a[i] = i; print "third loop" for (i in a) print a[i] print "call func" delit(a) print "fourth loop" for (i in a) print a[i] stressit() } function delit(arr) { delete arr } function stressit( array, i) { delete array array[4] = 4 array[5] = 5 delete array[5] print "You should just see: 4 4" for (i in array) print i, array[i] delete array print "You should see nothing between this line" for (i in array) print i, array[i] print "And this one" } beebe/gensub.ok0000644000175000017500000000012706254152077013266 0ustar arnoldarnold3 = , 2 = , 1 = a b c a BB c a b c a b CC a b CC a b CC DON'T PANIC beebe/compare.awk0000644000175000017500000000026705461100536013577 0ustar arnoldarnoldBEGIN { if (ARGV[1]) print 1 ARGV[1] = "" if (ARGV[2]) print 2 ARGV[2] = "" if ("0") print "zero" if ("") print "null" if (0) print 0 } { if ($0) print $0 if ($1) print $1 } beebe/negexp.ok0000644000175000017500000000000505461100540013247 0ustar arnoldarnold0.01 beebe/nofmtch.ok0000644000175000017500000000012606013734325013433 0ustar arnoldarnoldgawk: nofmtch.awk:1: warning: printf format specifier does not have control letter %3 beebe/getline.ok0000644000175000017500000000012005461100540013406 0ustar arnoldarnoldBEGIN { while( getline > 0) { print } } BEGIN { while( getline > 0) { print } } beebe/arrayref.ok0000644000175000017500000000000405461100537013601 0ustar arnoldarnold1 1 beebe/swaplns.in0000644000175000017500000000054705461100535013464 0ustar arnoldarnoldThis directory contains some examples/test-cases for different features of gawk - mostly not present in an old awk. Some are from "The GAWK Manual", some are original, and some are mixture of the two. Read header comments before attempting to use. Have fun and remember that program which consists only of BEGIN block does not need an input file. --mj beebe/fnaryscl.awk0000644000175000017500000000015506444555603014001 0ustar arnoldarnoldBEGIN { foo[1] = 4 f1(foo) } function f1(a) { f2(a) } function f2(b) { f3(b) } function f3(c) { c = 6 } beebe/convfmt.ok0000644000175000017500000000004306013302677013450 0ustar arnoldarnolda = 123.46 a = 123.456 a = 123.456 beebe/fsrs.awk0000644000175000017500000000015705461100537013125 0ustar arnoldarnoldBEGIN { RS=""; FS="\n"; ORS=""; OFS="\n"; } { split ($2,f," ") print $0; } beebe/lint.awk0000644000175000017500000000024706613166425013126 0ustar arnoldarnold# lint.awk --- test lint variable BEGIN { a[1] = 1 LINT = 1 delete a[2] LINT = "" delete a[3] LINT = "true" delete a[4] LINT = 0 delete a[5] print "done" } beebe/fnarray.awk0000644000175000017500000000007106254152076013613 0ustar arnoldarnoldfunction foo(N) { return 0 } BEGIN { Num = foo[c] } beebe/ofmtbig.ok0000644000175000017500000000002506614714547013435 0ustar arnoldarnold 0 99999999999 a 1 1 beebe/tradanch.awk0000644000175000017500000000002406254152111013721 0ustar arnoldarnold/foo^bar/ /foo$bar/ beebe/splitargv.in0000644000175000017500000000022005461100540013770 0ustar arnoldarnoldBEGIN { for (idx = 1; idx < ARGC; idx++) split(ARGV[idx], temp, "."); } { print $0; } beebe/pipeio1.ok0000644000175000017500000000000706345314771013350 0ustar arnoldarnold1 2 2 beebe/gsubasgn.ok0000644000175000017500000000054206254152101013601 0ustar arnoldarnoldgawk: gsubasgn.awk:4: function test1 (r) { gsub(r, "x", test1) } gawk: gsubasgn.awk:4: ^ gsub third parameter is not a changeable object gawk: gsubasgn.awk:8: function test2 () { gsub(/a/, "x", test2) } gawk: gsubasgn.awk:8: ^ gsub third parameter is not a changeable object beebe/funstack.in0000644000175000017500000002632706345314762013632 0ustar arnoldarnold%%% ==================================================================== %%% BibTeX-file{ %%% author = "Nelson H. F. Beebe", %%% version = "2.09", %%% date = "26 March 1997", %%% time = "08:21:19 MST", %%% filename = "cacm1970.bib", %%% address = "Center for Scientific Computing %%% Department of Mathematics %%% University of Utah %%% Salt Lake City, UT 84112 %%% USA", %%% telephone = "+1 801 581 5254", %%% FAX = "+1 801 581 4148", %%% checksum = "50673 40670 196033 1787829", %%% email = "beebe at math.utah.edu (Internet)", %%% codetable = "ISO/ASCII", %%% keywords = "bibliography, CACM, Communications of the %%% ACM", %%% supported = "yes", %%% docstring = "This is a bibliography of the journal %%% Communications of the ACM, covering %%% (incompletely) 1970 -- 1979. %%% %%% At version 2.09, the year coverage looked %%% like this: %%% %%% 1961 ( 1) 1972 (168) 1983 ( 0) %%% 1962 ( 1) 1973 (158) 1984 ( 0) %%% 1963 ( 2) 1974 (127) 1985 ( 2) %%% 1964 ( 2) 1975 (107) 1986 ( 0) %%% 1965 ( 1) 1976 ( 97) 1987 ( 0) %%% 1966 ( 2) 1977 (117) 1988 ( 0) %%% 1967 ( 1) 1978 (118) 1989 ( 0) %%% 1968 ( 1) 1979 ( 78) 1990 ( 2) %%% 1969 ( 3) 1980 ( 1) 1991 ( 4) %%% 1970 (157) 1981 ( 2) 1992 ( 1) %%% 1971 (104) 1982 ( 1) %%% %%% Article: 1252 %%% Book: 2 %%% InProceedings: 1 %%% Manual: 1 %%% MastersThesis: 1 %%% PhdThesis: 1 %%% %%% Total entries: 1258 %%% %%% The size of the original cacm.bib file %%% covering 1958--1996 became too large (about %%% 4000 entries) for BibTeX and TeX to handle, %%% so at version 1.44, it was split into %%% cacm1950.bib, cacm1960.bib, cacm1970.bib, %%% cacm1980.bib, and cacm1990.bib, each covering %%% the decade starting with the year embedded in %%% the filename. Version numbers for these %%% files begin at 2.00. %%% %%% Volumes from the 1990s average more than 200 %%% articles yearly, so a complete bibliography %%% for this journal could contain more than 6000 %%% entries from 1958 to 2000. %%% %%% These bibliographies also include ACM %%% Algorithms 1--492. For Algorithms 493--686, %%% including Algorithm 568, published in ACM %%% Transactions on Programming Languages and %%% Systems (TOPLAS), see the companion %%% bibliographies, toms.bib and toplas.bib. %%% %%% All published Remarks and Corrigenda are %%% cross-referenced in both directions, so %%% that citing a paper will automatically %%% generate citations for those Remarks and %%% Corrigenda. Cross-referenced entries are %%% duplicated in cacm19*.bib and toms.bib, so %%% that each is completely self-contained. %%% %%% Source code for ACM Algorithms from 380 %%% onwards, with some omissions, is available %%% via the Netlib service at %%% http://netlib.ornl.gov/, and %%% ftp://netlib.bell-labs.com/netlib/toms. %%% %%% There is a World Wide Web search facility %%% for articles published in this journal from %%% 1959 to 1979 at %%% http://ciir.cs.umass.edu/cgi-bin/web_query_form/public/cacm2.1. %%% %%% The initial draft of entries for 1981 -- %%% 1990 was extracted from the ACM Computing %%% Archive CD ROM for the 1980s, with manual %%% corrections and additions. Additions were %%% then made from all of the bibliographies in %%% the TeX User Group collection, from %%% bibliographies in the author's personal %%% files, from the Compendex database %%% (1970--1979), from the IEEE INSPEC database %%% (1970--1979), from tables of contents %%% information at http://www.acm.org/pubs/cacm/, %%% from Zentralblatt fur Mathematik Mathematics %%% Abstracts at %%% http://www.emis.de/cgi-bin/MATH/, from %%% bibliographies at Internet host %%% netlib.bell-labs.com, and from the computer %%% science bibliography collection on %%% ftp.ira.uka.de in /pub/bibliography to which %%% many people of have contributed. The %%% snapshot of this collection was taken on %%% 5-May-1994, and it consists of 441 BibTeX %%% files, 2,672,675 lines, 205,289 entries, and %%% 6,375 String{} abbreviations, occupying %%% 94.8MB of disk space. %%% %%% Numerous errors in the sources noted above %%% have been corrected. Spelling has been %%% verified with the UNIX spell and GNU ispell %%% programs using the exception dictionary %%% stored in the companion file with extension %%% .sok. %%% %%% BibTeX citation tags are uniformly chosen %%% as name:year:abbrev, where name is the %%% family name of the first author or editor, %%% year is a 4-digit number, and abbrev is a %%% 3-letter condensation of important title %%% words. Citation tags were automatically %%% generated by software developed for the %%% BibNet Project. %%% %%% In this bibliography, entries are sorted in %%% publication order within each journal, %%% using bibsort -byvolume. %%% %%% The checksum field above contains a CRC-16 %%% checksum as the first value, followed by the %%% equivalent of the standard UNIX wc (word %%% count) utility output of lines, words, and %%% characters. This is produced by Robert %%% Solovay's checksum utility.", %%% } %%% ==================================================================== @Preamble{"\input bibnames.sty " # "\input path.sty " # "\def \TM {${}^{\sc TM}$} " # "\hyphenation{ al-pha-mer-ic Balz-er Blom-quist Bo-ta-fo-go Bran-din Brans-comb Bu-tera Chris-tina Christ-o-fi-des Col-lins Cor-dell data-base econ-omies Fletch-er flow-chart flow-charts Fry-styk ge-dank-en Gar-fink-el Ge-ha-ni Glush-ko Goud-reau Gua-dan-go Hari-di Haw-thorn Hem-men-ding-er Hor-o-witz Hour-vitz Hirsch-berg Ike-da Ka-chi-tvi-chyan-u-kul Kat-ze-nel-son Kitz-miller Ko-ba-yashi Le-Me-tay-er Ken-ne-dy Law-rence Mac-kay Mai-net-ti Mar-sa-glia Max-well Mer-ner Mo-ran-di Na-ray-an New-ell Nich-ols para-digm pat-ent-ed Phi-lo-kyp-rou Prep-a-ra-ta pseu-do-chain-ing QUIK-SCRIPT Rad-e-mach-er re-eval-u-a-tion re-wind Ros-witha Scheu-er-mann Schwach-heim Schob-bens Schon-berg Sho-sha-ni Si-tha-ra-ma Skwa-rec-ki Streck-er Strin-gi-ni Tes-ler Te-zu-ka Teu-ho-la Till-quist Town-send Tsi-chri-tzis Tur-ski Vuille-min Wald-ing-er Za-bo-row-ski Za-mora }"} %======================================================================= % Acknowledgement abbreviations: @String{ack-nhfb = "Nelson H. F. Beebe, Center for Scientific Computing, Department of Mathematics, University of Utah, Salt Lake City, UT 84112, USA, Tel: +1 801 581 5254, FAX: +1 801 581 4148, e-mail: \path|beebe@math.utah.edu|"} @String{ack-nj = "Norbert Juffa, 2445 Mission College Blvd. Santa Clara, CA 95054 USA email: \path=norbert@iit.com="} %======================================================================= % Journal abbreviations: @String{j-CACM = "Communications of the ACM"} @String{j-COMP-SURV = "Computing Surveys"} @String{j-J-ACM = "Journal of the ACM"} @String{j-MANAGEMENT-SCIENCE = "Management Science"} @String{j-SIAM-J-COMPUT = "SIAM Journal of Computing"} @String{j-SPE = "Software --- Practice and Experience"} @String{j-TOMS = "ACM Transactions on Mathematical Software"} %======================================================================= % Publisher abbreviations: @String{pub-ANSI = "American National Standards Institute"} @String{pub-ANSI:adr = "1430 Broadway, New York, NY 10018, USA"} @String{pub-AW = "Ad{\-d}i{\-s}on-Wes{\-l}ey"} @String{pub-AW:adr = "Reading, MA, USA"} @String{pub-SUCSLI = "Stanford University Center for the Study of Language and Information"} @String{pub-SUCSLI:adr = "Stanford, CA, USA"} @String{pub-SV = "Spring{\-}er-Ver{\-}lag"} @String{pub-SV:adr = "Berlin, Germany~/ Heidelberg, Germany~/ London, UK~/ etc."} @MastersThesis{Dittmer:1976:IEP, author = "Ingo Dittmer", title = "{Implementation eines Einschrittcompilers f{\"u}r die Progammiersprache PASCAL auf der Rechenanlage IBM\slash 360 der Universit{\"a}t M{\"u}nster}. ({English} title: Implementation of a One-Step Compiler for the Programming Language {PASCAL} on the {IBM}\slash 360 of the {University of Muenster})", type = "Diplomearbeit", school = "Universit{\"a}t M{\"u}nster", address = "M{\"u}nster, Germany", pages = "??", month = "??", year = "1976", bibdate = "Sat Feb 17 13:24:29 1996", note = "Diplomearbeit M{\"u}nster 1976 und doert angegebene Literatur (English: Muenster diploma work 1976 and the literature cited therein). The hashing method was rediscovered fourteen years later by Pearson \cite{Pearson:1990:FHV}, and then commented on by several authors \cite{Dittmer:1991:NFH,Savoy:1991:NFH,Litsios:1991:NFH,Pearson:1991:NFH}.", acknowledgement = ack-nhfb, xxnote = "Cannot find in Dissertation Abstracts, European.", } beebe/intprec.ok0000644000175000017500000000002606014460750013437 0ustar arnoldarnold0000000005:000000000e beebe/ChangeLog0000644000175000017500000002545406614714645013241 0ustar arnoldarnoldSun Oct 25 23:11:46 1998 Arnold D. Robbins * Makefile.in (procinfs): new test case. * procinfs.awk, procinfs.ok: new files. * ofmtbig.awk, ofmtbig.in, ofmtbig.ok: new files. Tue Oct 20 22:07:10 1998 Arnold D. Robbins * Makefile.in (lint): new test case. * lint.awk, lint.ok: new files. * badargs.ok: updated output corresponding to change made to main.c (see main ChangeLog). Tue May 26 20:39:07 1998 Arnold D. Robbins * pipeio2.awk: change "\'" to "'" to avoid new warning. Mon Mar 23 21:53:36 1998 Arnold D. Robbins * Makefile.in (fnasgnm): new test case. * fnasgnm.awk, fnasgnm.in, fnasgnm.ok: new files. Fri Mar 20 11:01:38 1998 Arnold D. Robbins * Makefile.in (fnaryscl): new test case. * fnaryscl.awk, fnaryscl.ok: new files. Mon Mar 16 15:23:22 1998 Arnold D. Robbins * Makefile.in (splitdef): new test case. * splitdef.awk, splitdef.ok: new files. Fri Sep 26 01:10:14 1997 Arnold D. Robbins * Makefile.in (parseme): new test case. * parseme.awk, parseme.ok: new files. Sun Sep 14 23:25:10 1997 Arnold D. Robbins * Makefile.in (ofmts): new test case. * ofmts.awk, ofmts.in, ofmts.ok: new files. Sun Aug 17 07:17:35 1997 Arnold D. Robbins * Makefile.in (fsfwfs): new test case. * fsfwfs.awk, fsfwfs.in, fsfwfs.ok: new files. Sun Jul 27 23:08:53 1997 Arnold D. Robbins * Makefile.in (hsprint): new test case. * hsprint.awk, hsprint.ok, printfloat.awk: new files. Thu Jul 17 20:07:31 1997 Arnold D. Robbins * Makefile.in (ofmt): new test case. * ofmt.awk, ofmt.in, ofmt.ok: new files. Sun Jun 22 16:17:35 1997 Arnold D. Robbins * Makefile.in (nlinstr): new test case. * nlinstr.awk, nlinstr.in, nlinstr.ok: new files. Wed Jun 4 13:18:21 1997 Arnold D. Robbins * pid.sh: send errors to /dev/null to toss warning about using PROCINFO["pid"] etc. This test explicitly tests the special files. It'll need changing in 3.2. Thu Apr 24 23:24:59 1997 Arnold D. Robbins * Makefile.in (messages): remove special case if /dev/fd exists. Finally. ------------------------------------------------ Sun Nov 16 20:08:59 1997 Arnold D. Robbins * gsubtest.awk, gsubtest.ok: fix for count of matches in gsub from Geert.Debyser@esat.kuleuven.ac.be. Sun Nov 16 19:54:50 1997 Arnold D. Robbins * Makefile.in (strftime): fix a typo (LANC -> LANG). Thu May 15 12:49:08 1997 Arnold D. Robbins * Release 3.0.3: Release tar file made. Tue May 13 12:53:46 1997 Arnold D. Robbins * Makefile.in (messages): more testing for OK failure on Linux. Sun May 11 14:57:11 1997 Arnold D. Robbins * Makefile.in (nondec): new test case. * nondec.awk, nondec.ok: new files. Sun May 11 07:07:05 1997 Arnold D. Robbins * Makefile.in (prdupval): new test case. * prdupval.awk, prdupval.in, prdupval.ok: new files. Wed May 7 21:54:34 1997 Arnold D. Robbins * Makefile.in (delarprm): new test case. * delarprm.awk, delarprm.ok: new files. Wed May 7 17:54:00 1997 Arnold D. Robbins * Makefile.in (pid): several fixes from ghazi@caip.rutgers.edu. Tue May 6 20:28:30 1997 Arnold D. Robbins * Makefile.in (strftime): Use the right locale stuff. (clobber): don't need an input file. Thu Apr 24 22:24:42 1997 Arnold D. Robbins * Makefile.in (pid): new test case, from jco@convex.com. (specfile): removed test case, pid does it better. * pid.awk, pid.ok, pid.sh: new files. * specfile.awk: removed. Wed Apr 23 23:37:10 1997 Arnold D. Robbins * Makefile.in (pipeio2): new test case. * pipeio2.awk, pipeio2.ok, pipeio2.in: new files. Sun Apr 20 12:22:52 1997 Arnold D. Robbins * Makefile.in (clobber): new test case. * clobber.awk, clobber.ok: new files. Fri Apr 18 07:55:47 1997 Arnold D. Robbins * BETA Release 3.0.34: Release tar file made. Tue Apr 15 05:57:29 1997 Arnold D. Robbins * Makefile.in (strftlng): More wizardry for bizarre Unix systems. (nlfldsep): use program and input file, not shell script (basic, unix-tests, gawk.extensions): moved specfile, pipeio1 and strftlng into unix-tests per Pat Rankin. * nlfldsep.awk, nlfldsep.in: new files. * nlfldsep.sh: removed. Wed Apr 9 23:32:47 1997 Arnold D. Robbins * Makefile.in (funstack): new test case. * funstack.awk, funstack.in, funstack.ok: new files. * substr.awk: added many more tests. * substr.ok: updated Wed Mar 19 20:10:21 1997 Arnold D. Robbins * Makefile.in (pipeio1): new test case. * pipeio1.awk, pipeio1.ok: new files. Tue Mar 18 06:38:36 1997 Arnold D. Robbins * Makefile.in (noparm): new test case. * noparm.awk, noparm.ok: new files. Fri Feb 21 06:30:18 1997 Arnold D. Robbins * Makefile.in (reint): new test case. * reint.awk, reint.in, reint.ok: new files. Wed Feb 5 18:17:51 1997 Arnold D. Robbins * Makefile.in (fnarydel): new test case. * fnarydel.awk, fnarydel.ok: new files. Sun Jan 19 17:06:18 1997 Arnold D. Robbins * Makefile.in (nors): new test case. * nors.ok: new file. Sun Jan 19 17:06:18 1997 Arnold D. Robbins * Makefile.in (specfile, strftlng, nfldstr): new test cases. * specfile.awk, strftlng.awk, strftlng.ok, nfldstr.ok: new files. Fri Dec 27 11:27:13 1996 Arnold D. Robbins * Makefile.in (intest): new test case. * intest.awk, intest.ok: new files. Wed Dec 25 11:25:22 1996 Arnold D. Robbins * Release 3.0.2: Release tar file made. Tue Dec 10 23:09:26 1996 Arnold D. Robbins * Release 3.0.1: Release tar file made. Thu Nov 7 09:12:20 1996 Arnold D. Robbins * Makefile.in (splitvar): new test case. * splitvar.awk, splitvar.in, splitvar.ok: new files. Sun Nov 3 10:55:50 1996 Arnold D. Robbins * Makefile.in (nlfldsep): new test case. * nlfldsep.sh, nlfldsep.ok: new files. Fri Oct 25 10:29:56 1996 Arnold D. Robbins * rand.awk: call srand with fixed seed. * rand.ok: new file. * Makefile.in (rand): changed to compare output with rand.ok. Sat Oct 19 21:52:04 1996 Arnold D. Robbins * Makefile.in (tradanch): new test case. * tradanch.awk, tradanch.in, tradanch.ok: new files. Thu Oct 17 21:22:05 1996 Arnold D. Robbins * tweakfld.awk: move `rm' out into Makefile.in. * eofsplit.awk: fixed buggy code so won't loop forever. * Makefile.in (all): add unix-tests. (unix-tests): new target, has pound-bang, fflush, getlnhd. (basic): removed fflush, getlnhd. (tweakfld): added rm from tweakfld.awk. Sun Oct 6 22:00:35 1996 Arnold D. Robbins * Makefile.in (back89): new test case. * back89.in, back89.ok: new files. Sun Oct 6 20:45:54 1996 Arnold D. Robbins * Makefile.in (splitwht): new test case. * splitwht.awk, splitwht.ok: new files. Sun Sep 29 23:14:20 1996 Arnold D. Robbins * Makefile.in (gsubtest): new test case. * gsubtest.awk, gsubtest.ok: new files. Fri Sep 20 11:58:40 1996 Arnold D. Robbins * Makefile.in (prtoeval): new test case. * prtoeval.awk, prtoeval.ok: new files. Tue Sep 10 06:26:44 1996 Arnold D. Robbins * Makefile.in (gsubasgn): new test case. * gsubasgn.awk, gsubasgn.ok: new files. Wed Aug 28 22:06:33 1996 Arnold D. Robbins * badargs.ok: updated output corresponding to change made to main.c (see main ChangeLog). Thu Aug 1 07:20:28 1996 Arnold D. Robbins * Makefile.in (clean): remove out[123] files from `messages' test. Thanks to Pat Rankin (rankin@eql.caltech.edu). Sat Jul 27 23:56:57 1996 Arnold D. Robbins * Makefile.in (prt1eval): new test case. * prt1eval.awk, prt1eval.ok: new files. Mon Jul 22 22:06:10 1996 Arnold D. Robbins * Makefile.in (eofsplit): new test case. * eofsplit.awk, eofsplit.ok: new files. Sun Jul 14 07:07:45 1996 Arnold D. Robbins * Makefile.in (fldchgnf): new test case. * fldchgnf.awk, fldchgnf.ok: new files. Tue May 21 23:23:22 1996 Arnold D. Robbins * Makefile.in (substr): new test case. * substr.awk, substr.ok: new files. Tue May 14 15:05:23 1996 Arnold D. Robbins * Makefile.in (dynlj): new test case. * dynlj.awk, dynlj.ok: new files. Sun May 12 20:45:34 1996 Arnold D. Robbins * Makefile.in (fnarray): new test case. * fnarray.awk, fnarray.ok: new files. Fri Mar 15 06:46:48 1996 Arnold D. Robbins * Makefile.in (clean): added `*~' to list of files to be removed. * tweakfld.awk (END): added to do clean up action. Thu Mar 14 16:41:32 1996 Arnold D. Robbins * Makefile.in (mmap8k): new test case. * mmap8k.in, mmap8k.ok: new files. Sun Mar 10 22:58:35 1996 Arnold D. Robbins * Makefile.in (clsflnam): new test case. * clsflnam.in, clsflnam.awk, clsflnam.ok: new files. * tweakfld.awk: changed to have a fixed date. Thu Mar 7 09:56:09 1996 Arnold D. Robbins * Makefile.in (tweakfld): new test case. * tweakfld.in, tweakfld.awk, tweakfld.ok: new files. Sun Mar 3 06:51:26 1996 Arnold D. Robbins * Makefile.in (getlnhd, backgsub) : new test cases. * getlnhd.awk, getlnhd.ok: new files. * backgsub.in, backgsub.awk, backgsub.ok: new files. Mon Feb 26 22:30:02 1996 Arnold D. Robbins * Makefile.in (sprintfc): new test case. * sprintfc.in, sprintfc.awk, sprintfc.ok: new files. * gensub.awk: updated for case of no match of regex. Wed Jan 24 10:06:16 1996 Arnold D. Robbins * Makefile.in (distclean, maintainer-clean): new targets. (reindops): added test from Rick Adams (rick@uunet.uu.net). (arrayparm, paramdup, defref, strftime, prmarscl, sclforin, sclifin): Fix from Larry Schwimmer (schwim@cyclone.stanford.edu) so that tests that are supposed to fail use `... || exit 0' to cause a clean `make clean'. Wed Jan 10 22:58:55 1996 Arnold D. Robbins * ChangeLog created. beebe/printfloat.awk0000644000175000017500000000247705511144353014341 0ustar arnoldarnold# Test program for checking sprintf operation with various floating # point formats # # Watch out - full output of this program will have 3000 * tot lines, # which will take a chunk of space if you will write it to your disk. # --mj BEGIN { just = "-" plus = "+ " alt = "#" zero = "0" spec = "feEgG" fw[1] = "" fw[2] = "1" fw[3] = "5" fw[4] = "10" fw[5] = "15" prec[1] = ".-1" prec[2] = "" prec[3] = ".2" prec[4] = ".5" prec[5] = ".10" num = 123.6 factor = 1.0e-12 tot = 8 data[1] = 0 data[2] = 1 for (i = 3; i <= tot; i++) { data[i] = num * factor factor *= 1000 } for (j = 1; j <= 2; j++) { for (p = 1; p <= 3; p++) { for (a = 1; a <= 2; a++) { for (z = 1; z <= 2; z++) { for (s = 1; s <= 5; s++) { for (w = 1; w <= 5; w++) { for (r = 1; r <= 5; r++) { frmt = "|%" substr(just, j, 1) frmt = frmt substr(plus, p, 1) frmt = frmt substr(alt, a, 1) frmt = frmt substr(zero, z, 1) frmt = frmt fw[w] prec[r] frmt = frmt substr(spec, s, 1) "|" for (i = 1; i <= tot; i++) { result = sprintf(frmt, data[i]) # "normalize" if you must # sub(/\|\./, "|0.", result) printf("%-16s %-25s\t%g\n", frmt, result,data[i]) } } } } } } } } } beebe/sclforin.ok0000644000175000017500000000010006552543571013615 0ustar arnoldarnoldgawk: sclforin.awk:1: fatal: attempt to use scalar `j' as array beebe/ofmts.ok0000644000175000017500000000001006407125143013114 0ustar arnoldarnold1.2 2.2 beebe/clobber.ok0000644000175000017500000000000606345315013013377 0ustar arnoldarnold000801beebe/fldchg.ok0000644000175000017500000000006306056404164013226 0ustar arnoldarnold1: + +b c d e f 2: + +b d e f 2a:%+%+b%%d%e beebe/argarray.awk0000644000175000017500000000060105523034110013742 0ustar arnoldarnoldBEGIN { argn = " argument" (ARGC > 1 ? "s" : "") are = ARGC > 1 ? "are" : "is" print "here we have " ARGC argn print "which " are for (x = 0; x < ARGC; x++) print "\t", ARGV[x] print "Environment variable TEST=" ENVIRON["TEST"] print "and the current input file is called \"" FILENAME "\"" } FNR == 1 { print "in main loop, this input file is known as \"" FILENAME "\"" } beebe/back89.in0000644000175000017500000000001106254152066013047 0ustar arnoldarnolda8b a\8b beebe/ofmtbig.in0000644000175000017500000000000606614714530013421 0ustar arnoldarnolda 1 b beebe/backgsub.awk0000644000175000017500000000006006254152067013730 0ustar arnoldarnold{ gsub( "\\\\", "\\\\") print } beebe/clsflnam.awk0000644000175000017500000000036606254152070013751 0ustar arnoldarnold#! /usr/bin/awk -f BEGIN { getline # print ("FILENAME =", FILENAME) > "/dev/stderr" #Rewind the file if (close(FILENAME)) { print "Error " ERRNO " closing input file" > "/dev/stderr"; exit; } } { print "Analysing ", $0 } beebe/paramdup.awk0000644000175000017500000000015006013302677013755 0ustar arnoldarnoldBEGIN { foo(0, 1, 2) } function foo(a, b, c, b, a) { print "a =", a print "b =", b print "c =", c } beebe/nlinstr.ok0000644000175000017500000000000306353304450013457 0ustar arnoldarnoldok beebe/nlfldsep.awk0000644000175000017500000000011506345314763013763 0ustar arnoldarnoldBEGIN { RS = "A" } {print NF; for (i = 1; i <= NF; i++) print $i ; print ""} beebe/rand.ok0000644000175000017500000000011506254152105012714 0ustar arnoldarnold 27 17 86 27 22 53 61 11 33 48 51 97 99 35 20 27 62 100 32 beebe/pipeio2.in0000644000175000017500000000021406345314772013347 0ustar arnoldarnold January 1997 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 beebe/compare.ok0000644000175000017500000000001705461100537013420 0ustar arnoldarnold2 zero 1 1 0 1 beebe/asgext.in0000644000175000017500000000002005461100540013246 0ustar arnoldarnold1 2 3 1 1 2 3 4 beebe/nondec.awk0000644000175000017500000000004406345314766013426 0ustar arnoldarnoldBEGIN { print 0x81c3e8, 0x744018 } beebe/gsubtest.ok0000644000175000017500000000005506433632102013632 0ustar arnoldarnold1 aFOOc 4 XaXbXcX 3 XaXcX 1 abX 1 abX 1 abcX beebe/clsflnam.ok0000644000175000017500000000000006254152123013560 0ustar arnoldarnoldbeebe/nondec.ok0000644000175000017500000000002006345314766013247 0ustar arnoldarnold8504296 7618584 beebe/fldchgnf.awk0000644000175000017500000000005306254152073013721 0ustar arnoldarnold{ OFS = ":"; $2 = ""; print $0; print NF } beebe/posix.awk0000644000175000017500000000302105461100536013302 0ustar arnoldarnoldBEGIN { a = "+2"; b = 2; c = "+2a"; d = "+2 "; e = " 2" printf "Test #1: " if (b == a) print "\"" a "\"" " compares as a number" else print "\"" a "\"" " compares as a string" printf "Test #2: " if (b == c) print "\"" c "\"" " compares as a number" else print "\"" c "\"" " compares as a string" printf "Test #3: " if (b == d) print "\"" d "\"" " compares as a number" else print "\"" d "\"" " compares as a string" printf "Test #4: " if (b == e) print "\"" e "\"" " compares as a number" else print "\"" e "\"" " compares as a string" f = a + b + c + d + e print "after addition" printf "Test #5: " if (b == a) print "\"" a "\"" " compares as a number" else print "\"" a "\"" " compares as a string" printf "Test #6: " if (b == c) print "\"" c "\"" " compares as a number" else print "\"" c "\"" " compares as a string" printf "Test #7: " if (b == d) print "\"" d "\"" " compares as a number" else print "\"" d "\"" " compares as a string" printf "Test #8: " if (b == e) print "\"" e "\"" " compares as a number" else print "\"" e "\"" " compares as a string" printf "Test #9: " if ("3e5" > "5") print "\"3e5\" > \"5\"" else print "\"3e5\" <= \"5\"" printf "Test #10: " x = 32.14 y[x] = "test" OFMT = "%e" print y[x] printf "Test #11: " x = x + 0 print y[x] printf "Test #12: " OFMT="%f" CONVFMT="%e" print 1.5, 1.5 "" printf "Test #13: " if ( 1000000 "" == 1000001 "") print "match" else print "nomatch" } { printf "Test #14: " FS = ":" print $1 FS = "," printf "Test #15: " print $2 } beebe/splitdef.awk0000644000175000017500000000023206503036402013751 0ustar arnoldarnoldBEGIN { data = "abc:easy:as:one:two:three" FS = ":" FIELDWIDTHS = "3 1 4 1 2 1 3 1 3 1 5" n = split(data, a) printf "n = %d, a[3] = %s\n", n, a[3] } beebe/rand.awk0000644000175000017500000000014206254152104013064 0ustar arnoldarnoldBEGIN { srand(2) for (i = 0; i < 19; i++) printf "%3d ", (1 + int(100 * rand())) print "" } beebe/awkpath.ok0000644000175000017500000000001205461100541013417 0ustar arnoldarnoldFound it. beebe/out1.ok0000644000175000017500000000002405461100535012656 0ustar arnoldarnoldGoes to a file out1 beebe/backgsub.ok0000644000175000017500000000001206254152067013554 0ustar arnoldarnold\\x\\y\\z beebe/nasty.ok0000644000175000017500000000170306615644651013147 0ustar arnoldarnold123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123 X beebe/fstabplus.ok0000644000175000017500000000000405461100536013770 0ustar arnoldarnold1 2 beebe/tradanch.in0000644000175000017500000000002006254152112013542 0ustar arnoldarnoldfoo^bar foo$bar beebe/getnr2tm.ok0000644000175000017500000000005106617613276013547 0ustar arnoldarnold1 lines in 1 sec: 1 lines/sec; nlines=1 beebe/back89.ok0000644000175000017500000000000406254152066013054 0ustar arnoldarnolda8b beebe/igncfs.ok0000644000175000017500000000006305461100537013244 0ustar arnoldarnoldthis, is, handled, ok This, is, Not, hanDLed, Well beebe/splitvar.in0000644000175000017500000000003006254152106013626 0ustar arnoldarnoldHere===Is=Some=====Data beebe/prtoeval.ok0000644000175000017500000000004706254152104013627 0ustar arnoldarnold partial line: 'A STRING' beebe/fsbs.ok0000644000175000017500000000000405461100540012715 0ustar arnoldarnold1 2 beebe/sprintfc.awk0000644000175000017500000000004006254152110013762 0ustar arnoldarnold{ print sprintf("%c", $1), $1 } beebe/litoct.awk0000644000175000017500000000006706013743072013447 0ustar arnoldarnold{ if (/a\52b/) print "match" ; else print "no match" } beebe/igncfs.awk0000644000175000017500000000020405461100534013407 0ustar arnoldarnoldBEGIN { IGNORECASE=1 FS="[^a-z]+" } { for (i=1; i 0; --j) { for (p = 2; p > 0; --p) { for (s = 2; s > 0; --s) { for (a = 2; a > 0; --a) { for (z = 2; z > 0; --z) { fmt = "%" substr(just,j,1) substr(plus,p,1) \ substr(spc,s,1) substr(alt,a,1) substr(zero,z,1); fstr = sprintf(\ "%6s|%s%s|%s%s|%s%s|%s%s|%s%s|%s%s|\n", fmt, fmt, oper[r], fmt, oper[r+1], fmt, oper[r+2], fmt, oper[r+3], fmt, oper[r+4], fmt, oper[r+5]); printf(fstr, value[r], value[r+1], value[r+2], value[r+3], value[r+4], value[r+5]); } } } } } print ""; } } beebe/clobber.awk0000644000175000017500000000745706345314760013601 0ustar arnoldarnoldBEGIN { print "000800" > "seq" close("seq") ARGV[1] = "seq" ARGC = 2 } { printf "%06d", $1 + 1 >"seq"; printf "%06d", $1 + 1 } # Date: Mon, 20 Jan 1997 15:14:06 -0600 (CST) # From: Dave Bodenstab # To: bug-gnu-utils@prep.ai.mit.edu # Subject: GNU awk 3.0.2 core dump # Cc: arnold@gnu.ai.mit.edu # # The following program produces a core file on my FreeBSD system: # # bash$ echo 000800 >/tmp/seq # bash$ gawk '{ printf "%06d", $1 + 1 >"/tmp/seq"; # printf "%06d", $1 + 1 }' /tmp/seq # # This fragment comes from mgetty+sendfax. # # Here is the trace: # # Script started on Mon Jan 20 15:09:04 1997 # bash$ gawk --version # GNU Awk 3.0.2 # Copyright (C) 1989, 1991-1996 Free Software Foundation. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # bash$ gdb gawk # GDB is free software and you are welcome to distribute copies of it # under certain conditions; type "show copying" to see the conditions. # There is absolutely no warranty for GDB; type "show warranty" for details. # GDB 4.13 (i386-unknown-freebsd), # Copyright 1994 Free Software Foundation, Inc... # (gdb) shell echo 000800 >/tmp/seq # (gdb) r '{ printf "%06d", $1 + 1 >"/tmp/seq"; printf "%06d", $1 + 1 }(gdb) r '{ printf "%06d", $1 + 1 >"/tmp/seq"; printf "%06d", $1 + 1 }' /tmp/seq # Starting program: /scratch/archive/src/cmd/gnuawk-3.0.2/gawk '{ printf "%06d", $1 + 1 >"/tmp/seq"; printf "%06d", $1 + 1 }' /tmp/seq # # Program received signal SIGBUS, Bus error. # 0xd86f in def_parse_field (up_to=1, buf=0x37704, len=6, fs=0x3b240, rp=0x0, # set=0xce6c , n=0x0) at field.c:391 # 391 sav = *end; # (gdb) bt # #0 0xd86f in def_parse_field (up_to=1, buf=0x37704, len=6, fs=0x3b240, # rp=0x0, set=0xce6c , n=0x0) at field.c:391 # #1 0xddb1 in get_field (requested=1, assign=0x0) at field.c:669 # #2 0xc25d in r_get_lhs (ptr=0x3b9b4, assign=0x0) at eval.c:1339 # #3 0x9ab0 in r_tree_eval (tree=0x3b9b4, iscond=0) at eval.c:604 # #4 0xa5f1 in r_tree_eval (tree=0x3b9fc, iscond=0) at eval.c:745 # #5 0x4661 in format_tree (fmt_string=0x3e040 "%06d", n0=0, carg=0x3ba20) # at builtin.c:620 # #6 0x5beb in do_sprintf (tree=0x3b96c) at builtin.c:809 # #7 0x5cd5 in do_printf (tree=0x3ba8c) at builtin.c:844 # #8 0x9271 in interpret (tree=0x3ba8c) at eval.c:465 # #9 0x8ca3 in interpret (tree=0x3bbd0) at eval.c:308 # #10 0x8c34 in interpret (tree=0x3bc18) at eval.c:292 # #11 0xf069 in do_input () at io.c:312 # #12 0x12ba9 in main (argc=3, argv=0xefbfd538) at main.c:393 # (gdb) l # 386 *buf += len; # 387 return nf; # 388 } # 389 # 390 /* before doing anything save the char at *end */ # 391 sav = *end; # 392 /* because it will be destroyed now: */ # 393 # 394 *end = ' '; /* sentinel character */ # 395 for (; nf < up_to; scan++) { # (gdb) print end # $1 = 0x804d006 # (gdb) print buf # $2 = (char **) 0x37704 # (gdb) print *buf # $3 = 0x804d000 # (gdb) q # The program is running. Quit anyway (and kill it)? (y or n) y # bash$ exit # # Script done on Mon Jan 20 15:11:07 1997 # # Dave Bodenstab # imdave@synet.net beebe/fnarray.ok0000644000175000017500000000010306254152076013436 0ustar arnoldarnoldgawk: fnarray.awk:5: fatal: attempt to use function `foo' as array beebe/splitwht.ok0000644000175000017500000000000406254152107013645 0ustar arnoldarnold4 5 beebe/nors.in0000644000175000017500000000001106345315014012742 0ustar arnoldarnoldA B C D Ebeebe/argarray.in0000644000175000017500000000003306062075115013576 0ustar arnoldarnoldthis is a simple test file beebe/arrayparm.ok0000644000175000017500000000012706444560345014003 0ustar arnoldarnoldgawk: arrayparm.awk:18: fatal: attempt to use array `i (from foo)' in a scalar context beebe/lint.ok0000644000175000017500000000042706613167111012746 0ustar arnoldarnoldgawk: lint.awk:7: warning: delete: index `2' not in array `a' gawk: lint.awk:7: warning: turning off `--lint' from assignment to `LINT' gawk: lint.awk:11: warning: delete: index `4' not in array `a' gawk: lint.awk:11: warning: turning off `--lint' from assignment to `LINT' done beebe/rs.ok0000644000175000017500000000001305663664175012433 0ustar arnoldarnolda b c d e beebe/prt1eval.awk0000644000175000017500000000012106254152103013672 0ustar arnoldarnoldfunction tst () { sum += 1 return sum } BEGIN { OFMT = "%.0f" ; print tst() } beebe/fnasgnm.ok0000644000175000017500000000016106505530234013424 0ustar arnoldarnoldgawk: ./fnasgnm.awk:14: (FILENAME=fnasgnm.in FNR=1) fatal: can't use function name `ShowMe' as variable or array beebe/README0000644000175000017500000000123206254152065012323 0ustar arnoldarnoldMon Jan 22 13:08:58 EST 1996 This directory contains the tests for gawk. The tests use the following conventions. Given some aspect of gawk named `foo', there will be one or more of the following files: foo.awk --- actual code for the test if not inline in the Makefile foo.in --- the data for the test, if it needs data foo.ok --- the expected results _foo --- the actual results; generated at run time The _foo file will be left around if a test fails, allowing you to compare actual and expected results, in case they differ. If they do differ (other than strftime.ok and _strftime!), send in a bug report. See the manual for the bug report procedure. beebe/parseme.awk0000644000175000017500000000004506412641500013575 0ustar arnoldarnoldBEGIN { toupper(substr*line,1,12)) } beebe/badargs.ok0000644000175000017500000000136006613172323013401 0ustar arnoldarnoldgawk: option requires an argument -- f Usage: gawk [POSIX or GNU style options] -f progfile [--] file ... gawk [POSIX or GNU style options] [--] 'program' file ... POSIX options: GNU long options: -f progfile --file=progfile -F fs --field-separator=fs -v var=val --assign=var=val -m[fr] val -W compat --compat -W copyleft --copyleft -W copyright --copyright -W gen-po --gen-po -W help --help -W lint --lint -W lint-old --lint-old -W posix --posix -W re-interval --re-interval -W source=program-text --source=program-text -W traditional --traditional -W usage --usage -W version --version For Bug Reports, SEE THE GAWK MANUAL FOR INSTRUCTIONS, then send mail to: bug-gnu-utils@gnu.org, with a Cc: to arnold@gnu.org beebe/tradanch.ok0000644000175000017500000000000006254152123013545 0ustar arnoldarnoldbeebe/ofmts.awk0000644000175000017500000000005706407125110013272 0ustar arnoldarnoldBEGIN { OFMT= "%s" } { $1 + $2; print $1, $2 } beebe/manyfiles.awk0000644000175000017500000000003405663664174014151 0ustar arnoldarnold{ print $2 > ("junk/" $1) } beebe/prmarscl.awk0000644000175000017500000000007306014417466013777 0ustar arnoldarnoldfunction test(a) { print a[1] } BEGIN { j = 4; test(j) } beebe/splitwht.awk0000644000175000017500000000014206254152107014021 0ustar arnoldarnoldBEGIN { str = "a b\t\tc d" n = split(str, a, " ") print n m = split(str, b, / /) print m } beebe/fflush.sh0000755000175000017500000000125206707070117013273 0ustar arnoldarnold#! /bin/sh ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}' ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}'|cat ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");close("/dev/stdout");print "2nd"|"cat"}'|cat ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort"}'|cat ../a.out 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort";close("sort")}'|cat beebe/asgext.ok0000644000175000017500000000003305461100540013255 0ustar arnoldarnold3 1 2 3 a 1 a 3 1 2 3 a beebe/numsubstr.awk0000644000175000017500000000003506032205253014201 0ustar arnoldarnold{ print substr(1000+$1, 2) } beebe/delarprm.ok0000644000175000017500000000000006345315011013565 0ustar arnoldarnoldbeebe/childin.ok0000644000175000017500000000000306014462333013377 0ustar arnoldarnoldhi beebe/gnureops.awk0000644000175000017500000000277106044045306014016 0ustar arnoldarnold# test the gnu regexp ops BEGIN { if ("a rat is here" ~ /\yrat/) print "test 1 ok (\\y)" else print "test 1 failed (\\y)" if ("a rat is here" ~ /rat\y/) print "test 2 ok (\\y)" else print "test 2 failed (\\y)" if ("what a brat" !~ /\yrat/) print "test 3 ok (\\y)" else print "test 3 failed (\\y)" if ("in the crate" ~ /\Brat/) print "test 4 ok (\\B)" else print "test 4 failed (\\B)" if ("a rat" !~ /\Brat/) print "test 5 ok (\\B)" else print "test 5 failed (\\B)" if ("a word" ~ /\/) print "test 8 ok (\\>)" else print "test 8 failed (\\\\>)" if ("wordy" !~ /word\>/) print "test 9 ok (\\>)" else print "test 9 failed (\\>)" if ("a" ~ /\w/) print "test 10 ok (\\w)" else print "test 10 failed (\\\\w)" if ("+" !~ /\w/) print "test 11 ok (\\w)" else print "test 11 failed (\\w)" if ("a" !~ /\W/) print "test 12 ok (\\W)" else print "test 12 failed (\\W)" if ("+" ~ /\W/) print "test 13 ok (\\W)" else print "test 13 failed (\\W)" if ("a" ~ /\`a/) print "test 14 ok (\\`)" else print "test 14 failed (\\`)" if ("b" !~ /\`a/) print "test 15 ok (\\`)" else print "test 15 failed (\\`)" if ("a" ~ /a\'/) print "test 16 ok (\\')" else print "test 16 failed (\\')" if ("b" !~ /a\'/) print "test 17 ok (\\')" else print "test 17 failed (\\')" } beebe/fnarydel.ok0000644000175000017500000000025706345314761013614 0ustar arnoldarnoldfirst loop 4 5 6 7 8 9 1 2 3 second loop third loop 4 5 6 7 8 9 1 2 3 call func fourth loop You should just see: 4 4 4 4 You should see nothing between this line And this one beebe/nlfldsep.in0000644000175000017500000000005106345314764013607 0ustar arnoldarnoldsome stuff more stuffA junk stuffA final beebe/delarprm.awk0000644000175000017500000000405206345314761013764 0ustar arnoldarnold# From dragon!unagi.cis.upenn.edu!sjanet Tue Mar 25 17:12:20 1997 # Return-Path: # Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) # id ; Tue, 25 Mar 97 17:12 EST # Received: by vecnet.com (DECUS UUCP /2.0/2.0/2.0/); # Tue, 25 Mar 97 16:58:36 EDT # Received: from gnu-life.ai.mit.edu by antaries.vec.net (MX V4.2 VAX) with SMTP; # Tue, 25 Mar 1997 16:58:26 EST # Received: from linc.cis.upenn.edu by gnu-life.ai.mit.edu (8.8.5/8.6.12GNU) with # ESMTP id QAA24350 for ; Tue, 25 Mar # 1997 16:56:59 -0500 (EST) # Received: from unagi.cis.upenn.edu (UNAGI.CIS.UPENN.EDU [158.130.8.153]) by # linc.cis.upenn.edu (8.8.5/8.8.5) with ESMTP id QAA09424; Tue, 25 Mar # 1997 16:56:54 -0500 (EST) # Received: (from sjanet@localhost) by unagi.cis.upenn.edu (8.8.5/8.8.5) id # QAA03969; Tue, 25 Mar 1997 16:56:50 -0500 (EST) # Date: Tue, 25 Mar 1997 16:56:50 -0500 (EST) # From: Stan Janet # Message-ID: <199703252156.QAA03969@unagi.cis.upenn.edu> # To: bug-gnu-utils@prep.ai.mit.edu # CC: arnold@gnu.ai.mit.edu # Subject: GNU awk 3.0.2 bug: fatal error deleting local array inside function # Status: ORf # # Version: GNU Awk 3.0.2 # Platforms: SunOS 4.1.1 (compiled with Sun cc) # IRIX 5.3 (compiled with SGI cc) # Problem: Deleting local array inside function causes fatal internal error (and # core dump. The error does not occur when the variable "x", unused in # the example, is removed or when the function is declared foo(x,p). # When the function is declared foo(p,x), adding a dummy line that uses # "x", e.g. "x=1" does not prevent the error. If "p" is not deleted, # there is no error. If "p[1]" is used to delete the lone element, there # is no error. # # ==== The program x.gawk ==== function foo(p,x) { p[1]="bar" delete p return 0 } BEGIN { foo() } # ==== The output for "gawk -f x.gawk" (SunOS) ==== # # gawk: x.gawk:4: fatal error: internal error beebe/rswhite.awk0000644000175000017500000000005306013772005013627 0ustar arnoldarnoldBEGIN { RS = "" } { printf("<%s>\n", $0) } beebe/ofmt.ok0000644000175000017500000000023206363531555012750 0ustar arnoldarnoldalt/binaries/warez/crypto - - alt/fan/douglas-adams 7491 7407 alt/os/linux - - alt/security 9641 9617 alt/security/index - - alt/security/keydist 253 253 beebe/prmreuse.ok0000644000175000017500000000000006056404156013631 0ustar arnoldarnoldbeebe/sclifin.awk0000644000175000017500000000010406014460563013572 0ustar arnoldarnoldBEGIN { j = 4 if ("foo" in j) print "ouch" else print "ok" } beebe/fflush.ok0000644000175000017500000000010006047144311013251 0ustar arnoldarnold1st 2nd 1st 2nd 1st 2nd 1st 2nd 1st 2nd 1st 2nd 1st 2nd 1st 2nd beebe/prdupval.ok0000644000175000017500000000001506345314773013640 0ustar arnoldarnold1 one abcone beebe/pid.awk0000644000175000017500000000211606345314770012731 0ustar arnoldarnold# From: John C. Oppenheimer # Subject: gawk-3.0.2 pid test # To: arnold@skeeve.atl.ga.us # Date: Mon, 10 Feb 1997 08:31:55 -0600 (CST) # # Thanks for the very quick reply. # # This all started when I was looking for how to do the equivalent of # "nextfile." I was after documentation and found our gawk down a few # revs. # # Looks like the nextfile functionality was added somewhere around # 2.15.5. There wasn't a way to do it, until now! Thanks for the # functionality! # # Saw the /dev/xxx capability and just tried it. # # Anyway, I wrote a pid test. I hope that it is portable. Wanted to # make a user test, but looks like id(1) is not very portable. But a # little test is better than none. # # John # # pid.ok is a zero length file # # ================== pid.awk ============ BEGIN { getline pid <"/dev/pid" getline ppid <"/dev/ppid" } NR == 1 { if (pid != $0) { printf "Bad pid %d, wanted %d\n", $0, pid } } NR == 2 { if (ppid != $0) { printf "Bad ppid %d, wanted %d\n", $0, ppid } } END { # ADR --- added close("/dev/pid") close("/dev/ppid") } beebe/defref.awk0000644000175000017500000000002006013534264013372 0ustar arnoldarnoldBEGIN { foo() } beebe/prt1eval.ok0000644000175000017500000000000206254152103013517 0ustar arnoldarnold1 beebe/strftlng.ok0000644000175000017500000000202406345314777013654 0ustar arnoldarnold01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 01/01/70 00:00:00 beebe/posix.ok0000644000175000017500000000065505461100536013143 0ustar arnoldarnoldTest #1: "+2" compares as a string Test #2: "+2a" compares as a string Test #3: "+2 " compares as a string Test #4: " 2" compares as a string after addition Test #5: "+2" compares as a string Test #6: "+2a" compares as a string Test #7: "+2 " compares as a string Test #8: " 2" compares as a string Test #9: "3e5" <= "5" Test #10: test Test #11: test Test #12: 1.500000 1.500000e+00 Test #13: nomatch Test #14: 1:2,3 Test #15: 4 beebe/fldchg.in0000644000175000017500000000001706047161176013225 0ustar arnoldarnoldaa aab c d e f beebe/nlinstr.awk0000644000175000017500000000010606041076502013632 0ustar arnoldarnoldBEGIN { RS = "" } { if (/^@/) print "not ok" else print "ok" } beebe/getlnhd.ok0000644000175000017500000000005606254152100013414 0ustar arnoldarnoldselect * from user where Name = 'O\'Donell' beebe/tweakfld.ok0000644000175000017500000000214306254152113013573 0ustar arnoldarnold0.277 N/A N/A 1 1 ASC/Hank Donnelly N/A NONE ALL,ALL N/A N/A N/A Count Rate Linearity EIPS C-Ka 1.108 0.13484 N/A N/A C8H8 10.32 C8H8 20.64 FIXED-FREE 1000 NO 0 0 0 HRC,I 1000 N/A N/A N/A N/A N/A N/A N/A N/A N/A 0 N/A APT APT LISSAJOUS 44.7175 44.7175 1 N/A N/A N/A N/A N/A 0 N/A HRCCTRTLIN 0 N/A N/A N/A 10 N/A 180 0 0 N/A N/A FPSI rate HRMA/HRC,I Mar 10, 1996 0 0 0 0 0 N/A 1.486 N/A N/A 2 1 ASC/Hank Donnelly N/A NONE ALL,ALL N/A N/A N/A Count Rate Linearity EIPS Al-Ka 4.458 0.642119 N/A N/A Al 18.38 Al 36.76 FIXED-FREE 1000 NO 0 0 0 HRC,I 1000 N/A N/A N/A N/A N/A N/A N/A N/A N/A 0 N/A APT APT LISSAJOUS 5.55556 5.55556 1 N/A N/A N/A N/A N/A 0 N/A HRCCTRTLIN 0 N/A N/A N/A 10 N/A 180 0 0 N/A N/A FPSI rate HRMA/HRC,I Mar 10, 1996 0 0 0 0 0 N/A 4.51 N/A N/A 3 1 ASC/Hank Donnelly N/A NONE ALL,ALL N/A N/A N/A Count Rate Linearity EIPS Ti-Ka 22.55 3.02894 N/A N/A Ti 40.6 N/A N/A FIXED-FREE 1000 NO 0 0 0 HRC,I 1000 N/A N/A N/A N/A N/A N/A N/A N/A N/A 0 N/A APT APT LISSAJOUS 5.55556 5.55556 1 N/A N/A N/A N/A N/A 0 N/A HRCCTRTLIN 0 N/A N/A N/A 10 N/A 180 0 0 N/A N/A FPSI rate HRMA/HRC,I Mar 10, 1996 0 0 0 0 0 N/A beebe/fldchgnf.in0000644000175000017500000000001006254152074013537 0ustar arnoldarnolda b c d beebe/fnasgnm.in0000644000175000017500000000000506505530165013421 0ustar arnoldarnoldjunk beebe/sprintfc.ok0000644000175000017500000000002006254152110013607 0ustar arnoldarnoldA 65 B 66 f foo beebe/lib/0000755000175000017500000000000006707344222012214 5ustar arnoldarnoldbeebe/lib/awkpath.awk0000644000175000017500000000003405461100534014344 0ustar arnoldarnoldBEGIN { print "Found it." } beebe/splitdef.ok0000644000175000017500000000002106503223607013601 0ustar arnoldarnoldn = 6, a[3] = as beebe/numsubstr.in0000644000175000017500000000002006032204043014013 0ustar arnoldarnold5000 10000 5000 beebe/procinfs.ok0000644000175000017500000000020106614711671013620 0ustar arnoldarnoldInitially, PROCINFO["FS"] = FS After assign to FIELDWIDTHS, PROCINFO["FS"] = FIELDWIDTHS After assign to FS, PROCINFO["FS"] = FS beebe/rswhite.in0000644000175000017500000000001406013771763013462 0ustar arnoldarnold a b c d beebe/nlfldsep.ok0000644000175000017500000000006006254152102013573 0ustar arnoldarnold4 some stuff more stuff 2 junk stuff 1 final beebe/fsfwfs.in0000644000175000017500000000060006375556647013311 0ustar arnoldarnold00000113000 00000000000 00000275000 00000000000 00000321334 00000000000 00000048709 00000010000 00000117000 00000100000 00000152000 00000138000 00000000000 00000150000 00000189425 00000000000 00000146128 00000000000 00000146128 00000000000 00000146128 00000000000 00000000000 00000050000 00000000000 00000050000 00000000000 00000000000 00000158014 00000000000 00000113656 00000000000 beebe/nfset.in0000644000175000017500000000005005461100541013076 0ustar arnoldarnold1 2 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 7 8 1 beebe/pid.sh0000755000175000017500000000015506707070143012560 0ustar arnoldarnold#! /bin/sh AWK=${AWK-../a.out} echo $$ > _pid.in echo $1 >> _pid.in exec $AWK -f pid.awk _pid.in 2>/dev/null beebe/fnaryscl.ok0000644000175000017500000000015206504421330013607 0ustar arnoldarnoldgawk: ./fnaryscl.awk:10: fatal: attempt to use array `c (from b (from a (from foo)))' in a scalar context beebe/pid.ok0000644000175000017500000000000006345315011012533 0ustar arnoldarnoldbeebe/fsfwfs.ok0000644000175000017500000000064006375556674013320 0ustar arnoldarnold00000113000,00000000000,, 00000275000,00000000000,, 00000321334,00000000000,, 00000048709,00000010000,, 00000117000,00000100000,, 00000152000,00000138000,, 00000000000,00000150000,, 00000189425,00000000000,, 00000146128,00000000000,, 00000146128,00000000000,, 00000146128,00000000000,, 00000000000,00000050000,, 00000000000,00000050000,, 00000000000,00000000000,, 00000158014,00000000000,, 00000113656,00000000000,, beebe/reint.in0000644000175000017500000000002006345314776013120 0ustar arnoldarnoldmatch this: aaa beebe/prdupval.in0000644000175000017500000000000406345314773013633 0ustar arnoldarnoldone beebe/getnr2tb.in0000644000175000017500000000005206617617712013531 0ustar arnoldarnoldline 1 line 2 line 3 line 4 line 5 line 6 beebe/noparms.awk0000644000175000017500000000003306345314767013636 0ustar arnoldarnoldfunction x(a, b, c , ,) {} beebe/getline.awk0000644000175000017500000000005005461100540013561 0ustar arnoldarnoldBEGIN { while( getline > 0) { print } } beebe/igncfs.in0000644000175000017500000000005405461100534013236 0ustar arnoldarnoldthis is handled ok This is Not hanDLed Well beebe/fldchgnf.ok0000644000175000017500000000001106254152075013544 0ustar arnoldarnolda::c:d 4 beebe/funstack.ok0000644000175000017500000000000006345315011013575 0ustar arnoldarnoldbeebe/fldchg.awk0000644000175000017500000000020706047161154013376 0ustar arnoldarnold{ # print "0:", $0 gsub("aa", "+") print "1:", $0 $3 = "<" $3 ">" print "2:", $0 print "2a:" "%" $1 "%" $2 "%" $3 "%" $4 "%" $5 } beebe/compare.in0000644000175000017500000000001105461100537013407 0ustar arnoldarnold0 1 0 1 beebe/convfmt.awk0000644000175000017500000000040206013302677013620 0ustar arnoldarnoldBEGIN { CONVFMT = "%2.2f" a = 123.456 b = a "" # give `a' string value also printf "a = %s\n", a CONVFMT = "%.6g" printf "a = %s\n", a a += 0 # make `a' numeric only again printf "a = %s\n", a # use `a' as string } beebe/nors.ok0000644000175000017500000000000406345314767012765 0ustar arnoldarnoldE E beebe/noeffect.awk0000644000175000017500000000005106025531644013736 0ustar arnoldarnoldBEGIN { s == "hello, world"; print s } beebe/fsrs.ok0000644000175000017500000000002605461100536012746 0ustar arnoldarnolda b c d e f1 2 3 4 5 6beebe/math.awk0000644000175000017500000000040606047126237013104 0ustar arnoldarnoldBEGIN { pi = 3.1415927 printf "cos(%f) = %f\n", pi/4, cos(pi/4) printf "sin(%f) = %f\n", pi/4, sin(pi/4) e = exp(1) printf "e = %f\n", e printf "log(e) = %f\n", log(e) printf "sqrt(pi ^ 2) = %f\n", sqrt(pi ^ 2) printf "atan2(1, 1) = %f\n", atan2(1, 1) } beebe/nfset.awk0000644000175000017500000000002305461100541013252 0ustar arnoldarnold{ NF = 5 ; print } beebe/funstack.awk0000644000175000017500000006357506345314762014014 0ustar arnoldarnold### ==================================================================== ### @Awk-file{ ### author = "Nelson H. F. Beebe", ### version = "1.00", ### date = "09 October 1996", ### time = "15:57:06 MDT", ### filename = "journal-toc.awk", ### address = "Center for Scientific Computing ### Department of Mathematics ### University of Utah ### Salt Lake City, UT 84112 ### USA", ### telephone = "+1 801 581 5254", ### FAX = "+1 801 581 4148", ### URL = "http://www.math.utah.edu/~beebe", ### checksum = "25092 977 3357 26493", ### email = "beebe@math.utah.edu (Internet)", ### codetable = "ISO/ASCII", ### keywords = "BibTeX, bibliography, HTML, journal table of ### contents", ### supported = "yes", ### docstring = "Create a journal cover table of contents from ### Article{...} entries in a journal BibTeX ### .bib file for checking the bibliography ### database against the actual journal covers. ### The output can be either plain text, or HTML. ### ### Usage: ### bibclean -max-width 0 BibTeX-file(s) | \ ### bibsort -byvolume | \ ### awk -f journal-toc.awk \ ### [-v HTML=nnn] [-v INDENT=nnn] \ ### [-v BIBFILEURL=url] >foo.toc ### ### or if the bibliography is already sorted ### by volume, ### ### bibclean -max-width 0 BibTeX-file(s) | \ ### awk -f journal-toc.awk \ ### [-v HTML=nnn] [-v INDENT=nnn] \ ### [-v BIBFILEURL=url] >foo.toc ### ### A non-zero value of the command-line option, ### HTML=nnn, results in HTML output instead of ### the default plain ASCII text (corresponding ### to HTML=0). The ### ### The INDENT=nnn command-line option specifies ### the number of blanks to indent each logical ### level of HTML. The default is INDENT=4. ### INDENT=0 suppresses indentation. The INDENT ### option has no effect when the default HTML=0 ### (plain text output) option is in effect. ### ### When HTML output is selected, the ### BIBFILEURL=url command-line option provides a ### way to request hypertext links from table of ### contents page numbers to the complete BibTeX ### entry for the article. These links are ### created by appending a sharp (#) and the ### citation label to the BIBFILEURL value, which ### conforms with the practice of ### bibtex-to-html.awk. ### ### The HTML output form may be useful as a more ### compact representation of journal article ### bibliography data than the original BibTeX ### file provides. Of course, the ### table-of-contents format provides less ### information, and is considerably more ### troublesome for a computer program to parse. ### ### When URL key values are provided, they will ### be used to create hypertext links around ### article titles. This supports journals that ### provide article contents on the World-Wide ### Web. ### ### For parsing simplicity, this program requires ### that BibTeX ### ### key = "value" ### ### and ### ### @String{name = "value"} ### ### specifications be entirely contained on ### single lines, which is readily provided by ### the `bibclean -max-width 0' filter. It also ### requires that bibliography entries begin and ### end at the start of a line, and that ### quotation marks, rather than balanced braces, ### delimit string values. This is a ### conventional format that again can be ### guaranteed by bibclean. ### ### This program requires `new' awk, as described ### in the book ### ### Alfred V. Aho, Brian W. Kernighan, and ### Peter J. Weinberger, ### ``The AWK Programming Language'', ### Addison-Wesley (1988), ISBN ### 0-201-07981-X, ### ### such as provided by programs named (GNU) ### gawk, nawk, and recent AT&T awk. ### ### The checksum field above contains a CRC-16 ### checksum as the first value, followed by the ### equivalent of the standard UNIX wc (word ### count) utility output of lines, words, and ### characters. This is produced by Robert ### Solovay's checksum utility.", ### } ### ==================================================================== BEGIN { initialize() } /^ *@ *[Ss][Tt][Rr][Ii][Nn][Gg] *{/ { do_String(); next } /^ *@ *[Pp][Rr][Ee][Aa][Mm][Bb][Ll][Ee]/ { next } /^ *@ *[Aa][Rr][Tt][Ii][Cc][Ll][Ee]/ { do_Article(); next } /^ *@/ { do_Other(); next } /^ *author *= *\"/ { do_author(); next } /^ *journal *= */ { do_journal(); next } /^ *volume *= *\"/ { do_volume(); next } /^ *number *= *\"/ { do_number(); next } /^ *year *= *\"/ { do_year(); next } /^ *month *= */ { do_month(); next } /^ *title *= *\"/ { do_title(); next } /^ *pages *= *\"/ { do_pages(); next } /^ *URL *= *\"/ { do_URL(); next } /^ *} *$/ { if (In_Article) do_end_entry(); next } END { terminate() } ######################################################################## # NB: The programming conventions for variables in this program are: # # UPPERCASE global constants and user options # # Initialuppercase global variables # # lowercase local variables # # Any deviation is an error! # ######################################################################## function do_Article() { In_Article = 1 Citation_label = $0 sub(/^[^\{]*{/,"",Citation_label) sub(/ *, *$/,"",Citation_label) Author = "" Title = "" Journal = "" Volume = "" Number = "" Month = "" Year = "" Pages = "" Url = "" } function do_author() { Author = TeX_to_HTML(get_value($0)) } function do_end_entry( k,n,parts) { n = split(Author,parts," and ") if (Last_number != Number) do_new_issue() for (k = 1; k < n; ++k) print_toc_line(parts[k] " and", "", "") Title_prefix = html_begin_title() Title_suffix = html_end_title() if (html_length(Title) <= (MAX_TITLE_CHARS + MIN_LEADERS)) # complete title fits on line print_toc_line(parts[n], Title, html_begin_pages() Pages html_end_pages()) else # need to split long title over multiple lines do_long_title(parts[n], Title, html_begin_pages() Pages html_end_pages()) } function do_journal() { if ($0 ~ /[=] *"/) # have journal = "quoted journal name", Journal = get_value($0) else # have journal = journal-abbreviation, { Journal = get_abbrev($0) if (Journal in String) # replace abbrev by its expansion Journal = String[Journal] } gsub(/\\-/,"",Journal) # remove discretionary hyphens } function do_long_title(author,title,pages, last_title,n) { title = trim(title) # discard leading and trailing space while (length(title) > 0) { n = html_breakpoint(title,MAX_TITLE_CHARS+MIN_LEADERS) last_title = substr(title,1,n) title = substr(title,n+1) sub(/^ +/,"",title) # discard any leading space print_toc_line(author, last_title, (length(title) == 0) ? pages : "") author = "" } } function do_month( k,n,parts) { Month = ($0 ~ /[=] *"/) ? get_value($0) : get_abbrev($0) gsub(/[\"]/,"",Month) gsub(/ *# *\\slash *# */," / ",Month) gsub(/ *# *-+ *# */," / ",Month) n = split(Month,parts," */ *") Month = "" for (k = 1; k <= n; ++k) Month = Month ((k > 1) ? " / " : "") \ ((parts[k] in Month_expansion) ? Month_expansion[parts[k]] : parts[k]) } function do_new_issue() { Last_number = Number if (HTML) { if (Last_volume != Volume) { Last_volume = Volume print_line(prefix(2) "
") } html_end_toc() html_begin_issue() print_line(prefix(2) Journal "
") } else { print_line("") print_line(Journal) } print_line(strip_html(vol_no_month_year())) if (HTML) { html_end_issue() html_toc_entry() html_begin_toc() } else print_line("") } function do_number() { Number = get_value($0) } function do_Other() { In_Article = 0 } function do_pages() { Pages = get_value($0) sub(/--[?][?]/,"",Pages) } function do_String() { sub(/^[^\{]*\{/,"",$0) # discard up to and including open brace sub(/\} *$/,"",$0) # discard from optional whitespace and trailing brace to end of line String[get_key($0)] = get_value($0) } function do_title() { Title = TeX_to_HTML(get_value($0)) } function do_URL( parts) { Url = get_value($0) split(Url,parts,"[,;]") # in case we have multiple URLs Url = trim(parts[1]) } function do_volume() { Volume = get_value($0) } function do_year() { Year = get_value($0) } function get_abbrev(s) { # return abbrev from ``key = abbrev,'' sub(/^[^=]*= */,"",s) # discard text up to start of non-blank value sub(/ *,? *$/,"",s) # discard trailing optional whitspace, quote, # optional comma, and optional space return (s) } function get_key(s) { # return kay from ``key = "value",'' sub(/^ */,"",s) # discard leading space sub(/ *=.*$/,"",s) # discard everthing after key return (s) } function get_value(s) { # return value from ``key = "value",'' sub(/^[^\"]*\" */,"",s) # discard text up to start of non-blank value sub(/ *\",? *$/,"",s) # discard trailing optional whitspace, quote, # optional comma, and optional space return (s) } function html_accents(s) { if (index(s,"\\") > 0) # important optimization { # Convert common lower-case accented letters according to the # table on p. 169 of in Peter Flynn's ``The World Wide Web # Handbook'', International Thomson Computer Press, 1995, ISBN # 1-85032-205-8. The official table of ISO Latin 1 SGML # entities used in HTML can be found in the file # /usr/local/lib/html-check/lib/ISOlat1.sgml (your path # may differ). gsub(/{\\\a}/, "\\à", s) gsub(/{\\'a}/, "\\á", s) gsub(/{\\[\^]a}/,"\\â", s) gsub(/{\\~a}/, "\\ã", s) gsub(/{\\\"a}/, "\\ä", s) gsub(/{\\aa}/, "\\å", s) gsub(/{\\ae}/, "\\æ", s) gsub(/{\\c{c}}/,"\\ç", s) gsub(/{\\\e}/, "\\è", s) gsub(/{\\'e}/, "\\é", s) gsub(/{\\[\^]e}/,"\\ê", s) gsub(/{\\\"e}/, "\\ë", s) gsub(/{\\\i}/, "\\ì", s) gsub(/{\\'i}/, "\\í", s) gsub(/{\\[\^]i}/,"\\î", s) gsub(/{\\\"i}/, "\\ï", s) # ignore eth and thorn gsub(/{\\~n}/, "\\ñ", s) gsub(/{\\\o}/, "\\ò", s) gsub(/{\\'o}/, "\\ó", s) gsub(/{\\[\^]o}/, "\\ô", s) gsub(/{\\~o}/, "\\õ", s) gsub(/{\\\"o}/, "\\ö", s) gsub(/{\\o}/, "\\ø", s) gsub(/{\\\u}/, "\\ù", s) gsub(/{\\'u}/, "\\ú", s) gsub(/{\\[\^]u}/,"\\û", s) gsub(/{\\\"u}/, "\\ü", s) gsub(/{\\'y}/, "\\ý", s) gsub(/{\\\"y}/, "\\ÿ", s) # Now do the same for upper-case accents gsub(/{\\\A}/, "\\À", s) gsub(/{\\'A}/, "\\Á", s) gsub(/{\\[\^]A}/, "\\Â", s) gsub(/{\\~A}/, "\\Ã", s) gsub(/{\\\"A}/, "\\Ä", s) gsub(/{\\AA}/, "\\Å", s) gsub(/{\\AE}/, "\\Æ", s) gsub(/{\\c{C}}/,"\\Ç", s) gsub(/{\\\e}/, "\\È", s) gsub(/{\\'E}/, "\\É", s) gsub(/{\\[\^]E}/, "\\Ê", s) gsub(/{\\\"E}/, "\\Ë", s) gsub(/{\\\I}/, "\\Ì", s) gsub(/{\\'I}/, "\\Í", s) gsub(/{\\[\^]I}/, "\\Î", s) gsub(/{\\\"I}/, "\\Ï", s) # ignore eth and thorn gsub(/{\\~N}/, "\\Ñ", s) gsub(/{\\\O}/, "\\Ò", s) gsub(/{\\'O}/, "\\Ó", s) gsub(/{\\[\^]O}/, "\\Ô", s) gsub(/{\\~O}/, "\\Õ", s) gsub(/{\\\"O}/, "\\Ö", s) gsub(/{\\O}/, "\\Ø", s) gsub(/{\\\U}/, "\\Ù", s) gsub(/{\\'U}/, "\\Ú", s) gsub(/{\\[\^]U}/, "\\Û", s) gsub(/{\\\"U}/, "\\Ü", s) gsub(/{\\'Y}/, "\\Ý", s) gsub(/{\\ss}/, "\\ß", s) # Others not mentioned in Flynn's book gsub(/{\\'\\i}/,"\\í", s) gsub(/{\\'\\j}/,"j", s) } return (s) } function html_begin_issue() { print_line("") print_line(prefix(2) "
") print_line("") print_line(prefix(2) "

") print_line(prefix(3) "") } function html_begin_pages() { return ((HTML && (BIBFILEURL != "")) ? ("") : "") } function html_begin_pre() { In_PRE = 1 print_line("
")
}


function html_begin_title()
{
	return ((HTML && (Url != "")) ? ("") : "")
}


function html_begin_toc()
{
	html_end_toc()
	html_begin_pre()
}


function html_body( k)
{
	for (k = 1; k <= BodyLines; ++k)
		print Body[k]
}

function html_breakpoint(title,maxlength, break_after,k)
{
	# Return the largest character position in title AFTER which we
	# can break the title across lines, without exceeding maxlength
	# visible characters.
	if (html_length(title) > maxlength)	# then need to split title across lines
	{
		# In the presence of HTML markup, the initialization of
		# k here is complicated, because we need to advance it
		# until html_length(title) is at least maxlength,
		# without invoking the expensive html_length() function
		# too frequently.  The need to split the title makes the
		# alternative of delayed insertion of HTML markup much
		# more complicated.
		break_after = 0
		for (k = min(maxlength,length(title)); k < length(title); ++k)
		{
			if (substr(title,k+1,1) == " ")
			{		# could break after position k
				if (html_length(substr(title,1,k)) <= maxlength)
					break_after = k
				else	# advanced too far, retreat back to last break_after
					break
			}
		}
		if (break_after == 0)		# no breakpoint found by forward scan
		{				# so switch to backward scan
			for (k = min(maxlength,length(title)) - 1; \
				(k > 0) && (substr(title,k+1,1) != " "); --k)
				;		# find space at which to break title
			if (k < 1)		# no break point found
				k = length(title) # so must print entire string
		}
		else
			k = break_after
	}
	else					# title fits on one line
		k = length(title)
	return (k)
}



function html_end_issue()
{
	print_line(prefix(3) "")
	print_line(prefix(2) "

") } function html_end_pages() { return ((HTML && (BIBFILEURL != "")) ? "" : "") } function html_end_pre() { if (In_PRE) { print_line("") In_PRE = 0 } } function html_end_title() { return ((HTML && (Url != "")) ? "" : "") } function html_end_toc() { html_end_pre() } function html_fonts(s, arg,control_word,k,level,n,open_brace) { open_brace = index(s,"{") if (open_brace > 0) # important optimization { level = 1 for (k = open_brace + 1; (level != 0) && (k <= length(s)); ++k) { if (substr(s,k,1) == "{") level++ else if (substr(s,k,1) == "}") level-- } # {...} is now found at open_brace ... (k-1) for (control_word in Font_decl_map) # look for {\xxx ...} { if (substr(s,open_brace+1,length(control_word)+1) ~ \ ("\\" control_word "[^A-Za-z]")) { n = open_brace + 1 + length(control_word) arg = trim(substr(s,n,k - n)) if (Font_decl_map[control_word] == "toupper") # arg -> ARG arg = toupper(arg) else if (Font_decl_map[control_word] != "") # arg -> arg arg = "<" Font_decl_map[control_word] ">" arg "" return (substr(s,1,open_brace-1) arg html_fonts(substr(s,k))) } } for (control_word in Font_cmd_map) # look for \xxx{...} { if (substr(s,open_brace - length(control_word),length(control_word)) ~ \ ("\\" control_word)) { n = open_brace + 1 arg = trim(substr(s,n,k - n)) if (Font_cmd_map[control_word] == "toupper") # arg -> ARG arg = toupper(arg) else if (Font_cmd_map[control_word] != "") # arg -> arg arg = "<" Font_cmd_map[control_word] ">" arg "" n = open_brace - length(control_word) - 1 return (substr(s,1,n) arg html_fonts(substr(s,k))) } } } return (s) } function html_header() { USER = ENVIRON["USER"] if (USER == "") USER = ENVIRON["LOGNAME"] if (USER == "") USER = "????" "hostname" | getline HOSTNAME "date" | getline DATE ("ypcat passwd | grep '^" USER ":' | awk -F: '{print $5}'") | getline PERSONAL_NAME if (PERSONAL_NAME == "") ("grep '^" USER ":' /etc/passwd | awk -F: '{print $5}'") | getline PERSONAL_NAME print "" print "" print "" print "" print "" print "" print "" print "" print "" print prefix(1) "" print prefix(2) "" print prefix(3) Journal print prefix(2) "" print prefix(2) "" print prefix(1) "" print "" print prefix(1) "" } function html_label( label) { label = Volume "(" Number "):" Month ":" Year gsub(/[^A-Za-z0-9():,;.\/\-]/,"",label) return (label) } function html_length(s) { # Return visible length of s, ignoring any HTML markup if (HTML) { gsub(/<\/?[^>]*>/,"",s) # remove SGML tags gsub(/&[A-Za-z0-9]+;/,"",s) # remove SGML entities } return (length(s)) } function html_toc() { print prefix(2) "

" print prefix(3) "Table of contents for issues of " Journal print prefix(2) "

" print HTML_TOC } function html_toc_entry() { HTML_TOC = HTML_TOC " " HTML_TOC = HTML_TOC vol_no_month_year() HTML_TOC = HTML_TOC "
" "\n" } function html_trailer() { html_end_pre() print prefix(1) "" print "" } function initialize() { # NB: Update these when the program changes VERSION_DATE = "[09-Oct-1996]" VERSION_NUMBER = "1.00" HTML = (HTML == "") ? 0 : (0 + HTML) if (INDENT == "") INDENT = 4 if (HTML == 0) INDENT = 0 # indentation suppressed in ASCII mode LEADERS = " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ." MAX_TITLE_CHARS = 36 # 36 produces a 79-char output line when there is # just an initial page number. If this is # increased, the LEADERS string may need to be # lengthened. MIN_LEADERS = 4 # Minimum number of characters from LEADERS # required when leaders are used. The total # number of characters that can appear in a # title line is MAX_TITLE_CHARS + MIN_LEADERS. # Leaders are omitted when the title length is # between MAX_TITLE_CHARS and this sum. MIN_LEADERS_SPACE = " " # must be at least MIN_LEADERS characters long Month_expansion["jan"] = "January" Month_expansion["feb"] = "February" Month_expansion["mar"] = "March" Month_expansion["apr"] = "April" Month_expansion["may"] = "May" Month_expansion["jun"] = "June" Month_expansion["jul"] = "July" Month_expansion["aug"] = "August" Month_expansion["sep"] = "September" Month_expansion["oct"] = "October" Month_expansion["nov"] = "November" Month_expansion["dec"] = "December" Font_cmd_map["\\emph"] = "EM" Font_cmd_map["\\textbf"] = "B" Font_cmd_map["\\textit"] = "I" Font_cmd_map["\\textmd"] = "" Font_cmd_map["\\textrm"] = "" Font_cmd_map["\\textsc"] = "toupper" Font_cmd_map["\\textsl"] = "I" Font_cmd_map["\\texttt"] = "t" Font_cmd_map["\\textup"] = "" Font_decl_map["\\bf"] = "B" Font_decl_map["\\em"] = "EM" Font_decl_map["\\it"] = "I" Font_decl_map["\\rm"] = "" Font_decl_map["\\sc"] = "toupper" Font_decl_map["\\sf"] = "" Font_decl_map["\\tt"] = "TT" Font_decl_map["\\itshape"] = "I" Font_decl_map["\\upshape"] = "" Font_decl_map["\\slshape"] = "I" Font_decl_map["\\scshape"] = "toupper" Font_decl_map["\\mdseries"] = "" Font_decl_map["\\bfseries"] = "B" Font_decl_map["\\rmfamily"] = "" Font_decl_map["\\sffamily"] = "" Font_decl_map["\\ttfamily"] = "TT" } function min(a,b) { return (a < b) ? a : b } function prefix(level) { # Return a prefix of up to 60 blanks if (In_PRE) return ("") else return (substr(" ", \ 1, INDENT * level)) } function print_line(line) { if (HTML) # must buffer in memory so that we can accumulate TOC Body[++BodyLines] = line else print line } function print_toc_line(author,title,pages, extra,leaders,n,t) { # When we have a multiline title, the hypertext link goes only # on the first line. A multiline hypertext link looks awful # because of long underlines under the leading indentation. if (pages == "") # then no leaders needed in title lines other than last one t = sprintf("%31s %s%s%s", author, Title_prefix, title, Title_suffix) else # last title line, with page number { n = html_length(title) # potentially expensive extra = n % 2 # extra space for aligned leader dots if (n <= MAX_TITLE_CHARS) # then need leaders leaders = substr(LEADERS, 1, MAX_TITLE_CHARS + MIN_LEADERS - extra - \ min(MAX_TITLE_CHARS,n)) else # title (almost) fills line, so no leaders leaders = substr(MIN_LEADERS_SPACE,1, \ (MAX_TITLE_CHARS + MIN_LEADERS - extra - n)) t = sprintf("%31s %s%s%s%s%s %4s", \ author, Title_prefix, title, Title_suffix, \ (extra ? " " : ""), leaders, pages) } Title_prefix = "" # forget any hypertext Title_suffix = "" # link material # Efficency note: an earlier version accumulated the body in a # single scalar like this: "Body = Body t". Profiling revealed # this statement as the major hot spot, and the change to array # storage made the program more than twice as fast. This # suggests that awk might benefit from an optimization of # "s = s t" that uses realloc() instead of malloc(). if (HTML) Body[++BodyLines] = t else print t } function protect_SGML_characters(s) { gsub(/&/,"\\&",s) # NB: this one MUST be first gsub(//,"\\>",s) gsub(/\"/,"\\"",s) return (s) } function strip_braces(s, k) { # strip non-backslashed braces from s and return the result return (strip_char(strip_char(s,"{"),"}")) } function strip_char(s,c, k) { # strip non-backslashed instances of c from s, and return the result k = index(s,c) if (k > 0) # then found the character { if (substr(s,k-1,1) != "\\") # then not backslashed char s = substr(s,1,k-1) strip_char(substr(s,k+1),c) # so remove it (recursively) else # preserve backslashed char s = substr(s,1,k) strip_char(s,k+1,c) } return (s) } function strip_html(s) { gsub(/<\/?[^>]*>/,"",s) return (s) } function terminate() { if (HTML) { html_end_pre() HTML = 0 # NB: stop line buffering html_header() html_toc() html_body() html_trailer() } } function TeX_to_HTML(s, k,n,parts) { # First convert the four SGML reserved characters to SGML entities if (HTML) { gsub(/>/, "\\>", s) gsub(/ 1) ? "$" : "") \ ((k % 2) ? strip_braces(TeX_to_HTML_nonmath(parts[k])) : \ TeX_to_HTML_math(parts[k])) gsub(/[$][$][$]/,"$$",s) # restore display math return (s) } function TeX_to_HTML_math(s) { # Mostly a dummy for now, but HTML 3 could support some math translation gsub(/\\&/,"\\&",s) # reduce TeX ampersands to SGML entities return (s) } function TeX_to_HTML_nonmath(s) { if (index(s,"\\") > 0) # important optimization { gsub(/\\slash +/,"/",s) # replace TeX slashes with conventional ones gsub(/ *\\emdash +/," --- ",s) # replace BibNet emdashes with conventional ones gsub(/\\%/,"%",s) # reduce TeX percents to conventional ones gsub(/\\[$]/,"$",s) # reduce TeX dollars to conventional ones gsub(/\\#/,"#",s) # reduce TeX sharps to conventional ones if (HTML) # translate TeX markup to HTML { gsub(/\\&/,"\\&",s) # reduce TeX ampersands to SGML entities s = html_accents(s) s = html_fonts(s) } else # plain ASCII text output: discard all TeX markup { gsub(/\\\&/, "\\&", s) # reduce TeX ampersands to conventional ones gsub(/\\[a-z][a-z] +/,"",s) # remove TeX font changes gsub(/\\[^A-Za-z]/,"",s) # remove remaining TeX control symbols } } return (s) } function trim(s) { gsub(/^[ \t]+/,"",s) gsub(/[ \t]+$/,"",s) return (s) } function vol_no_month_year() { return ("Volume " wrap(Volume) ", Number " wrap(Number) ", " wrap(Month) ", " wrap(Year)) } function wrap(value) { return (HTML ? ("" value "") : value) } beebe/nfset.ok0000644000175000017500000000005205461100541013103 0ustar arnoldarnold1 2 1 2 3 4 1 2 3 4 5 1 2 3 4 5 1 beebe/out2.ok0000644000175000017500000000005605461100535012664 0ustar arnoldarnoldNormal print statement This printed on stdout beebe/nasty.awk0000644000175000017500000000603306615644577013330 0ustar arnoldarnold#From hankedr@manatee.dms.auburn.edu Tue Oct 13 22:15:59 1998 #Return-Path: #Received: from cssun.mathcs.emory.edu (cssun.mathcs.emory.edu [170.140.150.1]) # by dmx.netvision.net.il (8.9.0.Beta5/8.8.6) with ESMTP id PAA03924 # for ; Tue, 13 Oct 1998 15:32:13 +0200 (IST) #Received: from mescaline.gnu.org (we-refuse-to-spy-on-our-users@mescaline.gnu.org [158.121.106.21]) by cssun.mathcs.emory.edu (8.7.5/8.6.9-940818.01cssun) with ESMTP id KAA11644 for ; Tue, 13 Oct 1998 10:22:32 -0400 (EDT) #Received: from manatee.dms.auburn.edu (manatee.dms.auburn.edu [131.204.53.104]) # by mescaline.gnu.org (8.9.1a/8.9.1) with ESMTP id KAA03250 # for ; Tue, 13 Oct 1998 10:25:32 -0400 #Received: (from hankedr@localhost) # by manatee.dms.auburn.edu (8.9.1a/8.9.1) id JAA13348; # Tue, 13 Oct 1998 09:22:29 -0500 (CDT) #Date: Tue, 13 Oct 1998 09:22:29 -0500 (CDT) #Message-Id: <199810131422.JAA13348@manatee.dms.auburn.edu> #From: Darrel Hankerson #To: arnold@gnu.org #In-reply-to: <199810131313.QAA31784@alpha.netvision.net.il> (message from # Aharon Robbins on Tue, 13 Oct 1998 16:10:36 +0200) #Subject: Re: full text of bug report? #Mime-Version: 1.0 #Content-Type: text/plain; charset=US-ASCII #X-UIDL: bf3fce492dad4ab030c561e7b2f27d0a #Status: RO # # Do you have the full text of the a = a "\n" f() bug report? # I can't find it.... I'm not sure there really is a bug. # #Yes, see below. # #His example has unnecessary fragments (in particular, the use of #gensub is irrelevant). As I wrote to you earlier, the interesting #question for me is: # # Is the concatenation result undefined? If the result is defined or # implementation-dependent, then gawk has a bug. # # #=== Original report ===================================================== #From: Attila Torcsvari #To: "'bug-gnu-utils@prep.ai.mit.edu'" #Subject: gawk 3.0.3 bug #Date: Thu, 17 Sep 1998 18:12:13 +0200 #MIME-Version: 1.0 #Content-Transfer-Encoding: 7bit #Resent-From: bug-gnu-utils@gnu.org #X-Mailing-List: archive/latest/3396 #X-Loop: bug-gnu-utils@gnu.org #Precedence: list #Resent-Sender: bug-gnu-utils-request@gnu.org #Content-Transfer-Encoding: 7bit #Content-Type: text/plain; charset="us-ascii" #Content-Length: 618 # #Bug-gnuers, #please pass it to the responsible. # #The following generates something interesting: # BEGIN{ a="aaaaa" a=a a #10 a=a a #20 a=a a #40 a=a a #80 a=a a #160 a=a a # i.e. a is long enough a=a"\n"f() # this causes the trouble print a # guess the result } function f() { #print "a before: ", a #a=gensub("a","123,","g",a) # 'a' will be just a bit longer (4 times, but still should fit: 4*160=640) gsub(/a/, "123", a) #print "a after: ", a return "X" } # #Possible reason: #during f the a is modified, #it can be even freed, because gensub modifies its size #the printout contains trash. # #Used version: VC compiled WinNT 32 bit Intel. # #Regards, # #Attila Torcsvari #Arcanum Development # beebe/getnr2tb.awk0000644000175000017500000000641506617617712013716 0ustar arnoldarnold#From vp@dmat.uevora.pt Thu Jun 18 09:10 EDT 1998 #Received: from mescaline.gnu.org (we-refuse-to-spy-on-our-users@mescaline.gnu.org [158.121.106.21]) by cssun.mathcs.emory.edu (8.7.5/8.6.9-940818.01cssun) with ESMTP id JAA23649 for ; Thu, 18 Jun 1998 09:10:54 -0400 (EDT) #Received: from khromeleque.dmat.uevora.pt by mescaline.gnu.org (8.8.5/8.6.12GNU) with ESMTP id JAA21732 for ; Thu, 18 Jun 1998 09:11:19 -0400 #Received: from khromeleque.dmat.uevora.pt (vp@localhost [127.0.0.1]) # by khromeleque.dmat.uevora.pt (8.8.8/8.8.8/Debian/GNU) with ESMTP id OAA11817 # for ; Thu, 18 Jun 1998 14:13:57 +0100 #Message-Id: <199806181313.OAA11817@khromeleque.dmat.uevora.pt> #To: arnold@gnu.org #Subject: concatenation bug in gawk 3.0.3 #Date: Thu, 18 Jun 1998 14:13:57 +0200 #From: Vasco Pedro #Content-Type: text #Content-Length: 2285 #Status: RO # #Hi, # #The gawk program '{print NR " " 10/NR}' will print: # #1 10 #5 5 #3 3.33333 #2 2.5 #2 2 #1 1.66667 # #instead of the correct: # #1 10 #2 5 #3 3.33333 #4 2.5 #5 2 #6 1.66667 # #You'll notice, on the incorrect output, that the first column is #the first digit of the second. # #I think the problem comes from the way builtin variables are handled. #Since the items to be concatenated are processed in reverse order and #the return value of tree_eval(``NR'') is a pointer to the value part #of `NR_node', the `unref()' of `NR_node' due to its second occurrence #will leave a dangling pointer in `strlist'. The reason that it doesn't #reuse the freed space with objects of the same type. (Using Electric #Fence with EF_PROTECT_FREE set confirms that freed space is being #accessed.) # #The enclosed patch (hack would be a better word to describe it) is #all I could come up with. With it installed, things seem to work ok, #but I doubt this is the correct way to do it. (If I treated the #case for `Node_field_spec' as the I did others, `make check' would #fail in several places.) # #Regards, #vasco # #*** eval.c~ Tue May 6 21:39:55 1997 #--- eval.c Thu Jun 18 13:39:25 1998 #*************** #*** 685,697 **** # return func_call(tree->rnode, tree->lnode); # # /* unary operations */ # case Node_NR: # case Node_FNR: # case Node_NF: # case Node_FIELDWIDTHS: # case Node_FS: # case Node_RS: #- case Node_field_spec: # case Node_subscript: # case Node_IGNORECASE: # case Node_OFS: #--- 685,700 ---- # return func_call(tree->rnode, tree->lnode); # # /* unary operations */ #+ case Node_field_spec: #+ lhs = get_lhs(tree, (Func_ptr *) NULL); #+ return *lhs; #+ # case Node_NR: # case Node_FNR: # case Node_NF: # case Node_FIELDWIDTHS: # case Node_FS: # case Node_RS: # case Node_subscript: # case Node_IGNORECASE: # case Node_OFS: #*************** #*** 699,705 **** # case Node_OFMT: # case Node_CONVFMT: # lhs = get_lhs(tree, (Func_ptr *) NULL); #! return *lhs; # # case Node_var_array: # fatal("attempt to use array `%s' in a scalar context", #--- 702,710 ---- # case Node_OFMT: # case Node_CONVFMT: # lhs = get_lhs(tree, (Func_ptr *) NULL); #! r = dupnode(*lhs); #! r->flags |= TEMP; #! return r; # # case Node_var_array: # fatal("attempt to use array `%s' in a scalar context", # { print NR " " 10/NR } beebe/pcntplus.ok0000644000175000017500000000000506040276426013644 0ustar arnoldarnold+3 4 beebe/messages.awk0000644000175000017500000000055505461100535013757 0ustar arnoldarnold# This is a demo of different ways of printing with gawk. Try it # with and without -c (compatibility) flag, redirecting output # from gawk to a file or not. Some results can be quite unexpected. BEGIN { print "Goes to a file out1" > "out1" print "Normal print statement" print "This printed on stdout" > "/dev/stdout" print "You blew it!" > "/dev/stderr" } beebe/gnureops.ok0000644000175000017500000000042006044045635013637 0ustar arnoldarnoldtest 1 ok (\y) test 2 ok (\y) test 3 ok (\y) test 4 ok (\B) test 5 ok (\B) test 6 ok (\<) test 7 ok (\<) test 8 ok (\>) test 9 ok (\>) test 10 ok (\w) test 11 ok (\w) test 12 ok (\W) test 13 ok (\W) test 14 ok (\`) test 15 ok (\`) test 16 ok (\') test 17 ok (\') beebe/longwrds.awk0000644000175000017500000000070705461100535014006 0ustar arnoldarnold# From Gawk Manual modified by bug fix and removal of punctuation # Record every word which is used at least once { for (i = 1; i <= NF; i++) { tmp = tolower($i) if (0 != (pos = match(tmp, /([a-z]|-)+/))) used[substr(tmp, pos, RLENGTH)] = 1 } } #Find a number of distinct words longer than 10 characters END { num_long_words = 0 for (x in used) if (length(x) > 10) { ++num_long_words print x } print num_long_words, "long words" } beebe/longwrds.ok0000644000175000017500000000042313306115613013630 0ustar arnoldarnold20 long words compatibility concatenated consistency definitions description distributing fistatements gawk-options gnu-specific identically implementation implementations information non-portable pattern-action pre-defined program-file program-text programming restrictions beebe/nfldstr.ok0000644000175000017500000000000006345315011013433 0ustar arnoldarnoldbeebe/splitvar.ok0000644000175000017500000000000206254152107013631 0ustar arnoldarnold4 beebe/getnr2tm.in0000644000175000017500000000000206617613147013535 0ustar arnoldarnolda beebe/nlinstr.in0000644000175000017500000000001706041076525013464 0ustar arnoldarnoldline 1 @line 2 beebe/sclforin.awk0000644000175000017500000000005106014460506013760 0ustar arnoldarnoldBEGIN { j = 4; for (i in j) print j[i] } beebe/ignrcase.ok0000644000175000017500000000000305461100541013553 0ustar arnoldarnoldxz beebe/anchgsub.ok0000644000175000017500000000004505461100540013557 0ustar arnoldarnoldThis is a test, this is only a test. beebe/eofsplit.awk0000644000175000017500000000375606254152072014007 0ustar arnoldarnold# Date: Sat, 30 Mar 1996 12:47:17 -0800 (PST) # From: Charles Howes # To: bug-gnu-utils@prep.ai.mit.edu, arnold@gnu.ai.mit.edu # Subject: Bug in Gawk 3.0.0, sample code: # #!/usr/local/bin/gawk -f # # Hello! This is a bug report from chowes@direct.ca # # uname -a # SunOS hostname 5.5 Generic sun4m # # Gnu Awk (gawk) 3.0, patchlevel 0: BEGIN{ FS=":" while ((getline < "/etc/passwd") > 0) { r=$3 z=0 n[0]=1 } FS=" " } #gawk: fp.new:16: fatal error: internal error #Abort # #!/usr/local/bin/gawk -f # # Gnu Awk (gawk) 2.15, patchlevel 6 # # BEGIN{ # f="/etc/passwd" # while (getline < f) n[0]=1 # FS=" " # } # #gawk: /staff/chowes/bin/fp:7: fatal error: internal error # #Abort # These examples are not perfect coding style because I took a real # piece of code and tried to strip away anything that didn't make the error # message go away. # # The interesting part of the 'truss' is: # # fstat(3, 0xEFFFF278) = 0 # lseek(3, 0, SEEK_SET) = 0 # read(3, " r o o t : x : 0 : 1 : S".., 2291) = 2291 # brk(0x00050020) = 0 # brk(0x00052020) = 0 # read(3, 0x0004F4B8, 2291) = 0 # close(3) = 0 # Incurred fault #6, FLTBOUNDS %pc = 0x0001B810 # siginfo: SIGSEGV SEGV_MAPERR addr=0x00053000 # Received signal #11, SIGSEGV [caught] # siginfo: SIGSEGV SEGV_MAPERR addr=0x00053000 # write(2, " g a w k", 4) = 4 # write(2, " : ", 2) = 2 # # -- # Charles Howes -- chowes@direct.ca Voice: (604) 691-1607 # System Administrator Fax: (604) 691-1605 # Internet Direct - 1050 - 555 West Hastings St - Vancouver, BC V6B 4N6 # # A sysadmin's life is a sorry one. The only advantage he has over Emergency # Room doctors is that malpractice suits are rare. On the other hand, ER # doctors never have to deal with patients installing new versions of their # own innards! -Michael O'Brien # # "I think I know what may have gone wrong in the original s/w. # It's a bug in the way it was written." - Vagueness**n beebe/gsubtest.awk0000644000175000017500000000044006433632073014010 0ustar arnoldarnoldBEGIN { str = "abc"; print gsub("b+", "FOO", str), str str = "abc"; print gsub("x*", "X", str), str str = "abc"; print gsub("b*", "X", str), str str = "abc"; print gsub("c", "X", str), str str = "abc"; print gsub("c+", "X", str), str str = "abc"; print gsub("x*$", "X", str), str } beebe/backgsub.in0000644000175000017500000000000706254152067013555 0ustar arnoldarnold\x\y\z beebe/sprintfc.in0000644000175000017500000000001206254152110013605 0ustar arnoldarnold65 66 foo beebe/tweakfld.in0000644000175000017500000000174206254152113013574 0ustar arnoldarnold0.277 N/A N/A 1 1 ASC/Hank Donnelly N/A NONE ALL,ALL N/A N/A N/A Count Rate Linearity EIPS C-Ka 1.108 0.13484 N/A N/A C8H8 10.32 C8H8 20.64 FIXED 1000 NO 0 0 0 HRC,I 1000 N/A N/A N/A N/A N/A N/A N/A N/A N/A 0 N/A APT APT LISSAJOUS 44.7175 44.7175 1 N/A N/A N/A N/A N/A 0 N/A HRCCTRTLIN 0 N/A N/A N/A 10 N/A 180 0 0 N/A N/A FPSI rate 1.486 N/A N/A 2 1 ASC/Hank Donnelly N/A NONE ALL,ALL N/A N/A N/A Count Rate Linearity EIPS Al-Ka 4.458 0.642119 N/A N/A Al 18.38 Al 36.76 FIXED 1000 NO 0 0 0 HRC,I 1000 N/A N/A N/A N/A N/A N/A N/A N/A N/A 0 N/A APT APT LISSAJOUS 5.55556 5.55556 1 N/A N/A N/A N/A N/A 0 N/A HRCCTRTLIN 0 N/A N/A N/A 10 N/A 180 0 0 N/A N/A FPSI rate 4.51 N/A N/A 3 1 ASC/Hank Donnelly N/A NONE ALL,ALL N/A N/A N/A Count Rate Linearity EIPS Ti-Ka 22.55 3.02894 N/A N/A Ti 40.6 N/A N/A FIXED 1000 NO 0 0 0 HRC,I 1000 N/A N/A N/A N/A N/A N/A N/A N/A N/A 0 N/A APT APT LISSAJOUS 5.55556 5.55556 1 N/A N/A N/A N/A N/A 0 N/A HRCCTRTLIN 0 N/A N/A N/A 10 N/A 180 0 0 N/A N/A FPSI rate beebe/fieldwdth.ok0000644000175000017500000000000405461100537013740 0ustar arnoldarnold345 beebe/hsprint.ok0000644000175000017500000000710205513113255013462 0ustar arnoldarnold %| 45| 55| 2d| 12.68| 1.27e+01| 12.68| %0|00045|00055|0002d|0012.68|001.27e+01|0000012.68| %#| 45| 055| 0x2d| 12.68| 1.27e+01| 12.68| %#0|00045|00055|0x02d|0012.68|001.27e+01|0000012.68| % | 45| 55| 2d| 12.68| 1.27e+01| 12.68| % 0| 0045|00055|0002d| 012.68| 01.27e+01| 000012.68| % #| 45| 055| 0x2d| 12.68| 1.27e+01| 12.68| % #0| 0045|00055|0x02d| 012.68| 01.27e+01| 000012.68| %+| +45| 55| 2d| +12.68| +1.27e+01| +12.68| %+0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68| %+#| +45| 055| 0x2d| +12.68| +1.27e+01| +12.68| %+#0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68| %+ | +45| 55| 2d| +12.68| +1.27e+01| +12.68| %+ 0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68| %+ #| +45| 055| 0x2d| +12.68| +1.27e+01| +12.68| %+ #0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68| %-|45 |55 |2d |12.68 |1.27e+01 |12.68 | %-0|45 |55 |2d |12.68 |1.27e+01 |12.68 | %-#|45 |055 |0x2d |12.68 |1.27e+01 |12.68 | %-#0|45 |055 |0x2d |12.68 |1.27e+01 |12.68 | %- | 45 |55 |2d | 12.68 | 1.27e+01 | 12.68 | %- 0| 45 |55 |2d | 12.68 | 1.27e+01 | 12.68 | %- #| 45 |055 |0x2d | 12.68 | 1.27e+01 | 12.68 | %- #0| 45 |055 |0x2d | 12.68 | 1.27e+01 | 12.68 | %-+|+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | %-+0|+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | %-+#|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | %-+#0|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | %-+ |+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | %-+ 0|+45 |55 |2d |+12.68 |+1.27e+01 |+12.68 | %-+ #|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | %-+ #0|+45 |055 |0x2d |+12.68 |+1.27e+01 |+12.68 | %| zap| *| -3| -3.46| -3.46e+00| -3.457| %0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| %#| zap| *| -3.| -3.46| -3.46e+00| -3.457| %#0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| % | zap| *| -3| -3.46| -3.46e+00| -3.457| % 0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| % #| zap| *| -3.| -3.46| -3.46e+00| -3.457| % #0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| %+| zap| *| -3| -3.46| -3.46e+00| -3.457| %+0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| %+#| zap| *| -3.| -3.46| -3.46e+00| -3.457| %+#0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| %+ | zap| *| -3| -3.46| -3.46e+00| -3.457| %+ 0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| %+ #| zap| *| -3.| -3.46| -3.46e+00| -3.457| %+ #0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| %-|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %-0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %-#|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %-#0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %- |zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %- 0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %- #|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %- #0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %-+|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %-+0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %-+#|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %-+#0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %-+ |zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %-+ 0|zap |* |-3 |-3.46 |-3.46e+00 |-3.457 | %-+ #|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | %-+ #0|zap |* |-3. |-3.46 |-3.46e+00 |-3.457 | beebe/pcntplus.awk0000644000175000017500000000004206040276414014013 0ustar arnoldarnoldBEGIN { printf "%+d %d\n", 3, 4 } beebe/splitvar.awk0000644000175000017500000000006006254152106014005 0ustar arnoldarnold{ sep = "=+" n = split($0, a, sep) print n } beebe/ofmtbig.awk0000644000175000017500000000535206614714704013611 0ustar arnoldarnold# # [USEMAP] # # Problem Report gnu/7821 # # awk in free(): warning: chunk is already free. # # Confidential # no # # Severity # serious # # Priority # medium # # Responsible # freebsd-bugs@freebsd.org # # State # suspended # # Class # sw-bug # # Submitter-Id # current-users # # Arrival-Date # Thu Sep 3 10:30:00 PDT 1998 # # Last-Modified # Thu Sep 17 02:04:26 PDT 1998 # # Originator # Alexander Litvin archer@lucky.net # # Organization # # #Lucky Net ltd. # # Release # FreeBSD 3.0-CURRENT i386 # # Environment # # #FreeBSD grape.carrier.kiev.ua 3.0-CURRENT FreeBSD 3.0-CURRENT #121: Thu Sep 3 #1 #1:21:44 EEST 1998 archer@grape.carrier.kiev.ua:/usr/src/sys/compile/GRAPE #i #386 # # Description # # #The problem first appeared when GNU awk in 3.0-CURRENT was apgraded to #3.0.3. I run C-News, which uses awk extensively. After awk apgrade C-News #expire stopped to work. It appeared that some GNU awk 3.0.3 programms when #given absolutely legitimate input fail, giving out a number of messages: # #awk in free(): warning: chunk is already free. # # How-To-Repeat # # #Run the following awk program (it is cut out of C-News expire scripts). #I was not able to cut it down more -- omitting some portions of the #code (e.g. OFMT line), make error go away in this case, though it #certainly does not fix awk. # #----------------cut-here---------------- #!/usr/bin/awk -f BEGIN { OFMT = "%.12g" big = 99999999999 lowest = big small = 0 highest = small } $0 ~ /^[0-9]+$/ { if ($1 < lowest) lowest = $1 if ($1 > highest) highest = $1 next } $0 ~ /^[a-z]+/ { print dir, highest, lowest dir = $0 lowest = big highest = small } #----------------cut-here---------------- # #To get the error, just give this script the following input: #----------------cut-here---------------- #a #1 #b #----------------cut-here---------------- # # Fix # # #I was not able to track the error in awk sources. As a workaround, #I just reverted to GNU awk 2.15.5. # # Audit-Trail # # #State-Changed-From-To: open-suspended #State-Changed-By: phk #State-Changed-When: Thu Sep 17 02:04:08 PDT 1998 #State-Changed-Why: #reported to GNU maintainer. # # Submit Followup # _________________________________________________________________ # # # www@freebsd.org beebe/Makefile0000644000175000017500000003663313337176332013123 0ustar arnoldarnold# Makefile for GNU Awk test suite. # # Copyright (C) 1988-1997 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. # # GAWK is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GAWK is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA SHELL = /bin/sh AWK = ../gawk AWK = awk AWK = ../../a.out CMP = cmp srcdir = @srcdir@ srcdir = . VPATH = @srcdir@ VPATH = $(srcdir) all: bigtest # bigtest: basic unix-tests gawk.extensions bigtest: basic unix-tests # Tests in alphabetical order for progress feedback: # # Remove because of unexpected gawk extensions: # awkpath clsflnam fnasgnm fnaryscl litoct tradanch # # Remove because of differences from gawk output: # argarray arrayparm convfmt defref fnarray fnarydel fsbs gsubasgn # hsprint nasty nfset noeffect nofmtch nonl noparms paramdup parseme # prmarscl prtoeval rand reindops resplit sclforin sclifin # # Remove because it hangs on Intel Pentium GNU/Linux with lcc: # clobber basic: anchgsub arrayref asgext back89 backgsub childin compare delarprm \ dynlj eofsplit fldchg fldchgnf fsrs fstabplus funstack getline \ getnr2tb getnr2tm gsubtest intest intprec longwrds math messages \ mmap8k msg negexp nfldstr nlfldsep nlinstr nors numsubstr ofmt \ ofmtbig ofmts pcntplus prdupval prmreuse prt1eval reparse rs \ rswhite splitargv splitdef splitvar splitwht sprintfc substr \ swaplns tweakfld zeroflag # unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng # # Remove because of gawk extensions: # pipeio1 pipeio2 poundbang strftlng # # Remove because of differences from gawk output: # fflush inftest pid unix-tests: getlnhd gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \ badargs strftime gensub gnureops reint nondec fsfwfs \ lint procinfs # extra: regtest inftest # # Remove because of differences from gawk output: # inftest extra: regtest poundbang:: @cp $(AWK) /tmp/gawk && $(srcdir)/poundbang $(srcdir)/poundbang >_`basename $@` @rm -f /tmp/gawk $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` msg:: #@echo 'Any output from "cmp" is bad news, except for fp differences' swaplns:: @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@ $(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ messages:: @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3 $(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3 argarray:: @case $(srcdir) in \ .) : ;; \ *) cp $(srcdir)/argarray.in . ;; \ esac @TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@ $(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@ fstabplus:: @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@ $(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@ fsrs:: @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@ $(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@ igncfs:: @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@ $(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@ longwrds:: @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | LC_ALL=C sort >_$@ $(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@ fieldwdth:: @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@ $(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@ ignrcase:: @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@ $(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@ regtest:: @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' AWK=`pwd`/$(AWK) $(srcdir)/regtest posix:: @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ $(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@ manyfiles:: @rm -rf junk @mkdir junk @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ @echo "This number better be 1 ->" | tr -d '\012' @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l @rm -rf junk _$@ compare:: @$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@ $(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ arrayref:: @$(AWK) -f $(srcdir)/arrayref.awk >_$@ $(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@ rs:: @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@ $(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@ fsbs:: @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@ $(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@ inftest:: @echo This test is very machine specific... @$(AWK) -f $(srcdir)/inftest.awk >_$@ $(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline:: @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@ $(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@ rand:: @$(AWK) -f $(srcdir)/rand.awk >_$@ $(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@ negexp:: @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@ $(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@ asgext:: @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@ $(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@ anchgsub:: @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@ $(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@ splitargv:: @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@ $(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ awkpath:: @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ $(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ nfset:: @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@ $(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@ reparse:: @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@ $(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@ argtest:: @$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@ $(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ badargs:: @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@ $(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ convfmt:: @$(AWK) -f $(srcdir)/convfmt.awk >_$@ $(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@ arrayparm:: @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ paramdup:: @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@ nonl:: @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1 $(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ defref:: @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@ nofmtch:: @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1 $(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@ strftime:: : this test could fail on slow machines or on a second boundary, : so if it does, double check the actual results @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ date | $(AWK) '{ $$3 = sprintf("%02d", $$3 + 0) ; \ print > "strftime.ok" ; \ print strftime() > "'_$@'" }' $(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 litoct:: @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@ $(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ gensub:: @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@ $(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@ resplit:: @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@ $(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@ rswhite:: @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@ $(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@ prmarscl:: @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0 $(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ sclforin:: @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0 $(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ sclifin:: @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0 $(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@ intprec:: @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1 $(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@ childin:: @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@ $(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@ noeffect:: @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1 $(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@ numsubstr:: @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@ $(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@ gnureops:: @$(AWK) -f $(srcdir)/gnureops.awk >_$@ $(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@ pcntplus:: @$(AWK) -f $(srcdir)/pcntplus.awk >_$@ $(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@ prmreuse:: @$(AWK) -f $(srcdir)/prmreuse.awk >_$@ $(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@ math:: @$(AWK) -f $(srcdir)/math.awk >_$@ $(CMP) $(srcdir)/math.ok _$@ && rm -f _$@ fflush:: @$(srcdir)/fflush.sh >_$@ $(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@ fldchg:: @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@ $(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@ fldchgnf:: @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@ $(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@ reindops:: @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@ $(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@ sprintfc:: @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@ $(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@ getlnhd:: @$(AWK) -f $(srcdir)/getlnhd.awk >_$@ $(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@ backgsub:: @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@ $(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@ tweakfld:: @$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@ @rm -f errors.cleanup $(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@ clsflnam:: @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ $(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@ mmap8k:: @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@ $(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ fnarray:: @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@ dynlj:: @$(AWK) -f $(srcdir)/dynlj.awk >_$@ $(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@ substr:: @$(AWK) -f $(srcdir)/substr.awk >_$@ $(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@ eofsplit:: @$(AWK) -f $(srcdir)/eofsplit.awk >_$@ $(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@ prt1eval:: @$(AWK) -f $(srcdir)/prt1eval.awk >_$@ $(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@ gsubasgn:: @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@ prtoeval:: @$(AWK) -f $(srcdir)/prtoeval.awk >_$@ $(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@ gsubtest:: @$(AWK) -f $(srcdir)/gsubtest.awk >_$@ $(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@ splitwht:: @$(AWK) -f $(srcdir)/splitwht.awk >_$@ $(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@ back89:: @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@ $(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@ tradanch:: @$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@ $(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@ nlfldsep:: @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@ $(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@ splitvar:: @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@ $(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@ intest:: @$(AWK) -f $(srcdir)/intest.awk >_$@ $(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@ # AIX /bin/sh exec's the last command in a list, therefore issue a ":" # command so that pid.sh is fork'ed as a child before being exec'ed. pid:: @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : $(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in strftlng:: @TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ @if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \ TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \ fi $(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@ nfldstr:: @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@ $(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ nors:: @echo A B C D E | tr -d '\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ $(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ fnarydel:: @$(AWK) -f $(srcdir)/fnarydel.awk >_$@ $(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@ reint:: @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@ $(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@ noparms:: @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@ pipeio1:: @$(AWK) -f $(srcdir)/pipeio1.awk >_$@ @rm -f test1 test2 $(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ pipeio2:: @$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@ $(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@ funstack:: @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@ $(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@ clobber:: @$(AWK) -f $(srcdir)/clobber.awk >_$@ $(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@ @rm -f seq delarprm:: @$(AWK) -f $(srcdir)/delarprm.awk >_$@ $(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@ prdupval:: @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@ $(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@ nondec:: @if grep BITOP ../config.h | grep define > /dev/null; \ then \ $(AWK) -f $(srcdir)/nondec.awk >_$@; \ else \ cp $(srcdir)/nondec.ok _$@; \ fi $(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@ nasty:: @$(AWK) -f $(srcdir)/nasty.awk >_$@ $(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@ zeroflag:: @$(AWK) -f $(srcdir)/zeroflag.awk >_$@ $(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@ getnr2tm:: @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@ $(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@ getnr2tb:: @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@ $(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@ nlinstr:: @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@ $(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@ ofmt:: @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@ $(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@ hsprint:: @$(AWK) -f $(srcdir)/hsprint.awk >_$@ $(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@ fsfwfs:: @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@ $(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@ ofmts:: @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@ $(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@ parseme:: @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@ splitdef:: @$(AWK) -f $(srcdir)/splitdef.awk >_$@ $(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@ fnaryscl:: @$(AWK) -f $(srcdir)/fnaryscl.awk >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@ fnasgnm:: @$(AWK) -f $(srcdir)/fnasgnm.awk fnasgnm.in >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@ lint:: @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1 $(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@ procinfs:: @-$(AWK) -f $(srcdir)/procinfs.awk > _$@ $(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@ ofmtbig:: @$(AWK) -f $(srcdir)/ofmtbig.awk ofmtbig.in >_$@ 2>&1 || exit 0 $(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@ clean: rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~ distclean: clean # rm -f Makefile maintainer-clean: distclean beebe/pipeio2.awk0000644000175000017500000000373506532577037013541 0ustar arnoldarnold# From: megaadm@rina.quantum.de # Subject: Bug report - closing down pipes which read from shell com # To: bug-gnu-utils@prep.ai.mit.edu # Date: Thu, 27 Feb 1997 23:19:16 +0100 (CET) # CC: arnold@gnu.ai.mit.edu # # Hello people, # # i think i found a bug or something mysterious behaviour in # gawk Version 3.0 patchlevel 0. # # I am running on linux 2.0.25 under bash. # # Could you please have a look at the following awk program # an let me please know, if this is what i expect it to, # namely a bug. # # ----------- cut here -------------------------------------------- BEGIN { # OS is linux 2.0.25 # shell is bash # Gnu Awk (gawk) 3.0, patchlevel 0 # The command i typed on the shell was "gawk -f -" #com = "cal 01 1997" com = ("cat " SRCDIR "/pipeio2.in") while ((com | getline fnam) > 0) { com_tr = "echo " fnam " | tr [0-9]. ..........." # print "\'" com_tr "\'" print "'" com_tr "'" com_tr | getline nam print nam # please run that program and take a look at the # output. I think this is what was expected. # Then comment in the following 4 lines and see # what happens. I expect the first pipe "com | getline" # not to be close, but i think this is exactly what happens # So, is this ok ? if (close(com_tr) < 0) { print ERRNO break } } close(com) } # ----------- cut here -------------------------------------------- # # There is another thing i do not understand. # Why doesn't the awk - command "close" reports an # error, if i would say close("abc") which i had never # openend ? # # Regards, # Ulrich Gvbel # -- # /********************************************************\ # * Ulrich Gvbel, goebel@quantum.de * # * Quantum Gesellschaft f|r Software mbH, Dortmund * # * phone : +49-231-9749-201 fax: +49-231-9749-3 * # * private: +49-231-803994 fax: +49-231-803994 * # \********************************************************/ beebe/reint.ok0000644000175000017500000000000306345314776013124 0ustar arnoldarnold13 beebe/pipeio2.ok0000644000175000017500000000076606345314772013366 0ustar arnoldarnold'echo January 1997 | tr [0-9]. ...........' January .... 'echo S M Tu W Th F S | tr [0-9]. ...........' S M Tu W Th F S 'echo 1 2 3 4 | tr [0-9]. ...........' . . . . 'echo 5 6 7 8 9 10 11 | tr [0-9]. ...........' . . . . . .. .. 'echo 12 13 14 15 16 17 18 | tr [0-9]. ...........' .. .. .. .. .. .. .. 'echo 19 20 21 22 23 24 25 | tr [0-9]. ...........' .. .. .. .. .. .. .. 'echo 26 27 28 29 30 31 | tr [0-9]. ...........' .. .. .. .. .. .. 'echo | tr [0-9]. ...........' beebe/parseme.ok0000644000175000017500000000026106412641523013431 0ustar arnoldarnoldgawk: parseme.awk:1: BEGIN { toupper(substr*line,1,12)) } gawk: parseme.awk:1: ^ parse error gawk: parseme.awk:1: fatal: toupper() cannot have 0 arguments beebe/reparse.in0000644000175000017500000000001205461100541013416 0ustar arnoldarnold1 axbxc 2 beebe/inftest.ok0000644000175000017500000000257605461100537013462 0ustar arnoldarnold100000 100 100000000 100000 1e+11 100000000 1e+14 1e+11 1e+17 1e+14 1e+20 1e+17 1e+23 1e+20 1e+26 1e+23 1e+29 1e+26 1e+32 1e+29 1e+35 1e+32 1e+38 1e+35 1e+41 1e+38 1e+44 1e+41 1e+47 1e+44 1e+50 1e+47 1e+53 1e+50 1e+56 1e+53 1e+59 1e+56 1e+62 1e+59 1e+65 1e+62 1e+68 1e+65 1e+71 1e+68 1e+74 1e+71 1e+77 1e+74 1e+80 1e+77 1e+83 1e+80 1e+86 1e+83 1e+89 1e+86 1e+92 1e+89 1e+95 1e+92 1e+98 1e+95 1e+101 1e+98 1e+104 1e+101 1e+107 1e+104 1e+110 1e+107 1e+113 1e+110 1e+116 1e+113 1e+119 1e+116 1e+122 1e+119 1e+125 1e+122 1e+128 1e+125 1e+131 1e+128 1e+134 1e+131 1e+137 1e+134 1e+140 1e+137 1e+143 1e+140 1e+146 1e+143 1e+149 1e+146 1e+152 1e+149 1e+155 1e+152 1e+158 1e+155 1e+161 1e+158 1e+164 1e+161 1e+167 1e+164 1e+170 1e+167 1e+173 1e+170 1e+176 1e+173 1e+179 1e+176 1e+182 1e+179 1e+185 1e+182 1e+188 1e+185 1e+191 1e+188 1e+194 1e+191 1e+197 1e+194 1e+200 1e+197 1e+203 1e+200 1e+206 1e+203 1e+209 1e+206 1e+212 1e+209 1e+215 1e+212 1e+218 1e+215 1e+221 1e+218 1e+224 1e+221 1e+227 1e+224 1e+230 1e+227 1e+233 1e+230 1e+236 1e+233 1e+239 1e+236 1e+242 1e+239 1e+245 1e+242 1e+248 1e+245 1e+251 1e+248 1e+254 1e+251 1e+257 1e+254 1e+260 1e+257 1e+263 1e+260 1e+266 1e+263 1e+269 1e+266 1e+272 1e+269 1e+275 1e+272 1e+278 1e+275 1e+281 1e+278 1e+284 1e+281 1e+287 1e+284 1e+290 1e+287 1e+293 1e+290 1e+296 1e+293 1e+299 1e+296 1e+302 1e+299 1e+305 1e+302 1e+308 1e+305 Inf 1e+308 Inf Inf loop terminated beebe/anchgsub.awk0000644000175000017500000000004305461100540013726 0ustar arnoldarnold{ gsub(/^[ ]*/, "", $0) ; print } beebe/dynlj.ok0000644000175000017500000000003206254152072013111 0ustar arnoldarnoldhello world beebe/tweakfld.awk0000644000175000017500000001540406254152112013747 0ustar arnoldarnold# To: bug-gnu-utils@prep.ai.mit.edu # Cc: arnold@gnu.ai.mit.edu # Date: Mon, 20 Nov 1995 11:39:29 -0500 # From: "R. Hank Donnelly" # # Operating system: Linux1.2.13 (Slackware distrib) # GAWK version: 2.15 (?) # compiler: GCC (?) # # The following enclosed script does not want to fully process the input data # file. It correctly executes the operations on the first record, and then dies # on the second one. My true data file is much longer but this is # representative and it does fail on a file even as short as this one. # The failure appears to occur in the declared function add2output. Between the # steps of incrementing NF by one and setting $NF to the passed variable # the passed variable appears to vanish (i.e. NF does go from 68 to 69 # and before incrementing it "variable" equals what it should but after # "variable" has no value at all.) # # The scripts have been developed using nawk on a Sun (where they run fine) # I have tried gawk there but get a different crash which I have not yet traced # down. Ideally I would like to keep the script the same so that it would run # on either gawk or nawk (that way I can step back and forth between laptop and # workstation. # # Any ideas why the laptop installation is having problems? # Hank # # # #!/usr/bin/gawk -f BEGIN { # set a few values FS = "\t" OFS = "\t" pi = atan2(0, -1) # distance from HRMA to focal plane in mm fullradius = 10260.54 # set locations of parameters on input line nf_nrg = 1 nf_order = 3 nf_item = 4 nf_suite = 5 nf_grating = 8 nf_shutter = 9 nf_type = 13 nf_src = 14 nf_target = 15 nf_voltage = 16 nf_flux = 17 nf_filt1 = 20 nf_filt1_th = 21 nf_filt2 = 22 nf_filt2_th = 23 nf_bnd = 24 nf_hrma_polar = 27 nf_hrma_az = 28 nf_detector = 30 nf_acis_read = 32 nf_acis_proc = 33 nf_acis_frame = 34 nf_hxda_aplist = 36 nf_hxda_y_range = 37 nf_hxda_z_range = 38 nf_hxda_y_step = 39 nf_hxda_z_step = 40 nf_sim_z = 41 nf_fam_polar = 43 nf_fam_az = 44 nf_fam_dither_type = 45 nf_mono_init = 51 nf_mono_range = 52 nf_mono_step = 53 nf_defocus = 54 nf_acis_temp = 55 nf_tight = 59 nf_offset_y = 64 nf_offset_z = 65 while( getline < "xrcf_mnemonics.dat" > 0 ) { mnemonic[$1] = $2 } # "date" | getline date_line # ADR: use a fixed date so that testing will work date_line = "Sun Mar 10 23:00:27 EST 1996" split(date_line, in_date, " ") out_date = in_date[2] " " in_date[3] ", " in_date[6] } function add2output( variable ) { #print("hi1") >> "debug" NF++ #print("hi2") >> "debug" $NF = variable #print("hi3") >> "debug" } function error( ekey, message ) { print "Error at input line " NR ", anode " ekey >> "errors.cleanup" print " " message "." >> "errors.cleanup" } function hxda_na() { $nf_hxda_aplist = $nf_hxda_y_range = $nf_hxda_z_range = "N/A" $nf_hxda_y_step = $nf_hxda_z_step = "N/A" } function acis_na() { $nf_acis_read = $nf_acis_proc = $nf_acis_frame = $nf_acis_temp = "N/A" } function hrc_na() { # print ("hi") >> "debug" } function fpsi_na() { acis_na() hrc_na() $nf_sim_z = $nf_fam_polar = $nf_fam_az = $nf_fam_dither_type = "N/A" } function mono_na() { $nf_mono_init = $nf_mono_range = $nf_mono_step = "N/A" } # this gives the pitch and yaw of the HRMA and FAM # positive pitch is facing the source "looking down" # positive yaw is looking left # 0 az is north 90 is up # this also adds in the FAM X,Y,Z positions function polaz2yawpitch(polar, az) { theta = az * pi / 180 phi = polar * pi / 180 / 60 if( polar == 0 ) { add2output( 0 ) add2output( 0 ) } else { if(az == 0 || az == 180) add2output( 0 ) else add2output( - polar * sin(theta) ) # x = cos (phi) # y = sin (phi) * cos (theta) # add2output( atan2(y,x)*180 / pi * 60 ) if(az == 90 || az ==270 ) add2output( 0 ) else add2output( - polar * cos(theta) ) } # x = cos (phi) # z= sin (phi) * sin (theta) # add2output( atan2(z,x)*180 / pi * 60 ) if(config !~ /HXDA/) { # negative values of defocus move us farther from the source thus # increasing radius radius = fullradius - defocus # FAM_x; FAM_y; FAM_z if((offset_y == 0) && (offset_z == 0)){ add2output( fullradius - radius * cos (phi) ) if (az == 90 || az ==270) add2output( 0 ) else add2output( radius * sin (phi) * cos (theta) ) if (az == 0 || az == 180) add2output( 0 ) else add2output( - radius * sin (phi) * sin (theta) ) } else { # ******* THIS SEGMENT OF CODE IS NOT MATHEMATICALLY CORRECT FOR **** # OFF AXIS ANGLES AND IS SUPPLIED AS A WORKAROUND SINCE IT WILL # PROBABLY ONLY BE USED ON AXIS. add2output( defocus ) add2output( offset_y ) add2output( offset_z ) } } else { add2output( "N/A" ) add2output( "N/A" ) add2output( "N/A" ) } } # set TIGHT/LOOSE to N/A if it is not one of the two allowed values function tight_na() { if( $nf_tight !~ /TIGHT|LOOSE/ ) { $nf_tight == "N/A" } } # this entry is used to give certain entries names { type = $nf_type item = $nf_item suite = $nf_suite order = $nf_order detector = $nf_detector grating = $nf_grating offset_y= $nf_offset_y offset_z= $nf_offset_z bnd = $nf_bnd defocus = $nf_defocus } { # make configuration parameter # as well as setting configuration-dependent N/A values if( $nf_bnd ~ "SCAN" ) { # BND is scanning beam config = "BND" hxda_na() fpsi_na() } else { if( grating == "NONE" ) { config = "HRMA" } else { if( grating == "HETG" ) { if( order != "Both" ) { $nf_shutter = order substr($nf_shutter, \ index($nf_shutter, ",") ) } } else { order = "N/A" } config = "HRMA/" grating } if( detector ~ /ACIS|HRC/ ) { detsys = detector nsub = sub("-", ",", detsys) config = config "/" detsys hxda_na() } else { config = config "/HXDA" fpsi_na() if( detector == "HSI" ) { hxda_na() } } } add2output( config ) if( $nf_src ~ /EIPS|Penning/ ) mono_na() if( $nf_src == "Penning" ) $nf_voltage = "N/A" itm = sprintf("%03d", item) if(config in mnemonic) { if( type in mnemonic ) { ID = mnemonic[config] "-" mnemonic[type] "-" suite "." itm add2output( ID ) } else { error(type, "measurement type not in list") } } else { error(config, "measurement configuration not in list") } # add date to output line add2output( out_date ) # Convert HRMA polar and azimuthal angles to yaw and pitch polaz2yawpitch($nf_hrma_polar, $nf_hrma_az) # set TIGHT/LOOSE to N/A if it is not one of the two allowed values tight_na() # compute number of HXDA apertures if( config ~ /HXDA/ && $nf_hxda_aplist != "N/A") add2output( split( $nf_hxda_aplist, dummy, "," ) ) else add2output( "N/A" ) # make sure the BND value is properly set if($nf_bnd == "FIXED" && detector ~ /ACIS/) $nf_bnd =bnd"-SYNC" else $nf_bnd = bnd"-FREE" print } beebe/zeroflag.awk0000644000175000017500000000005306617041621013756 0ustar arnoldarnoldBEGIN { printf("%2.1d---%02.1d\n", 2, 2) } beebe/poundbang.ok0000644000175000017500000000003705461100541013744 0ustar arnoldarnoldaverage line length is 32.6667 beebe/splitargv.ok0000644000175000017500000000022005461100541013774 0ustar arnoldarnoldBEGIN { for (idx = 1; idx < ARGC; idx++) split(ARGV[idx], temp, "."); } { print $0; } beebe/getnr2tb.ok0000644000175000017500000000004706617617712013540 0ustar arnoldarnold1 10 2 5 3 3.33333 4 2.5 5 2 6 1.66667 beebe/intest.ok0000644000175000017500000000000406345314763013306 0ustar arnoldarnold0 1 beebe/fnasgnm.awk0000755000175000017500000000076706505527537013630 0ustar arnoldarnold# AFP_Bug1.awk - illustrate a problem with `gawk' (GNU Awk 3.0.3 on OS/2) # Arthur Pool .. pool@commerce.uq.edu.au # $Id: AFP_Bug1.awk,v 1.1 1998-03-17 12:22:44+10 pool Exp pool $ # Assignment to a variable with the same name as a function from within # that function causes an ABEND. # # Yes, I do realise that it's not a smart thing to do, but an error # message would be a kinder response than a core dump (and would make # debugging a whole lot easier). {ShowMe()} function ShowMe() {ShowMe = 1} beebe/splitargv.awk0000644000175000017500000000022005461100540014144 0ustar arnoldarnoldBEGIN { for (idx = 1; idx < ARGC; idx++) split(ARGV[idx], temp, "."); } { print $0; } beebe/prmreuse.awk0000644000175000017500000000027406046030674014016 0ustar arnoldarnold# from Pat Rankin, rankin@eql.caltech.edu BEGIN { dummy(1); legit(); exit } function dummy(arg) { return arg } function legit( scratch) { split("1 2 3", scratch) return "" } beebe/reindops.ok0000644000175000017500000000001306254152106013611 0ustar arnoldarnoldgawk is ok beebe/reparse.ok0000644000175000017500000000002205461100541013422 0ustar arnoldarnold1 1 a b c 2 1 a b beebe/paramdup.ok0000644000175000017500000000026006013302677013606 0ustar arnoldarnoldgawk: paramdup.awk:4: error: function `foo': parameter #4, `b', duplicates parameter #2 gawk: paramdup.awk:4: error: function `foo': parameter #5, `a', duplicates parameter #1 beebe/noparms.ok0000644000175000017500000000032106345314767013465 0ustar arnoldarnoldgawk: noparms.awk:1: function x(a, b, c , ,) {} gawk: noparms.awk:1: ^ parse error gawk: noparms.awk:1: function x(a, b, c , ,) {} gawk: noparms.awk:1: ^ parse error beebe/reint.awk0000644000175000017500000000003406345314773013276 0ustar arnoldarnold{ print match($0, /a{3}/) } beebe/noeffect.ok0000644000175000017500000000031306626646713013601 0ustar arnoldarnoldgawk: noeffect.awk:3: warning: statement may have no effect gawk: noeffect.awk:2: warning: reference to uninitialized variable `s' gawk: noeffect.awk:4: warning: reference to uninitialized variable `s' beebe/anchgsub.in0000644000175000017500000000005005461100540013550 0ustar arnoldarnold This is a test, this is only a test. beebe/intprec.awk0000644000175000017500000000005006014460723013605 0ustar arnoldarnoldBEGIN { printf "%.10d:%.10x\n", 5, 14 } beebe/ofmt.awk0000644000175000017500000000237506363531455013132 0ustar arnoldarnold# From dragon!knorke.saar.de!florian Wed Jul 16 10:47:27 1997 # Return-Path: # Message-ID: <19970716164451.63610@knorke.saar.de> # Date: Wed, 16 Jul 1997 16:44:51 +0200 # From: Florian La Roche # To: bug-gnu-utils@prep.ai.mit.edu # CC: arnold@gnu.ai.mit.edu # Subject: bug in gawk 3.0.3 # MIME-Version: 1.0 # Content-Type: text/plain; charset=us-ascii # X-Mailer: Mutt 0.76 # Status: R # Content-Length: 1725 # X-Lines: 177 # X-Display-Position: 0 # # I have a problem with gawk 3.0.3 on linux with libc 5.4.33. # The memory is corrupted, if I use OFMT = "%.12g". # With OFMT = "%.6g" evrything works fine, but I don't have enough # digits for the computation. # # Thanks a lot, # Florian La Roche # # Here is the sample awk-Script together with sample data: # BEGIN { OFMT = "%.12g" big = 99999999999 lowest = big small = 0 highest = small dir = "" } $0 ~ /^[0-9]+$/ { # some old awks do not think $0 is numeric, so use $1 if ($1 < lowest) lowest = $1 if ($1 > highest) highest = $1 next } $0 ~ /\/\.:$/ { if (dir != "") { if (highest != small) print dir, highest, lowest else print dir, "-", "-" } dir = substr($0, 1, length($0)-3) # trim off /.: lowest = big highest = small } beebe/fsbs.in0000644000175000017500000000000405461100540012712 0ustar arnoldarnold1\2 beebe/gensub.awk0000644000175000017500000000041106254152077013433 0ustar arnoldarnoldBEGIN { a = "this is a test of gawk" b = gensub(/(this).*(test).*(gawk)/, "3 = <\\3>, 2 = <\\2>, 1 = <\\1>", 1, a) print b } NR == 1 { print gensub(/b/, "BB", 2) } NR == 2 { print gensub(/c/, "CC", "global") } END { print gensub(/foo/, "bar", 1, "DON'T PANIC") } beebe/reg/0000755000175000017500000000000006707344222012223 5ustar arnoldarnoldbeebe/reg/exp-eq.in0000644000175000017500000000000605461100534013736 0ustar arnoldarnold1 2 3 beebe/reg/func2.awk0000644000175000017500000000006105461100534013731 0ustar arnoldarnoldfunction dummy() { ; } BEGIN { print dummy (1) } beebe/reg/log.good0000644000175000017500000000016605461100534013651 0ustar arnoldarnoldlog: SING error -Inf gawk: reg/log.awk:1: warning: log called with negative argument -1 log: DOMAIN error NaN 4.60517 beebe/reg/log.awk0000644000175000017500000000005205461100533013474 0ustar arnoldarnoldBEGIN { print log(0), log(-1), log(100) } beebe/reg/exp.awk0000644000175000017500000000005705461100533013514 0ustar arnoldarnoldBEGIN { print exp(0), exp(1000000), exp(0.5) } beebe/reg/exp-eq.awk0000644000175000017500000000002605461100534014114 0ustar arnoldarnold{ $0 ^= 3 ; print $1} beebe/reg/log.out0000644000175000017500000000036506707071765013552 0ustar arnoldarnold/a/sundown/export/home/0002/beebe/src/bwkawk/19990416/test/../a.out: log result out of range source line number 1 1 /a/sundown/export/home/0002/beebe/src/bwkawk/19990416/test/../a.out: log argument out of domain source line number 1 1 4.60517 beebe/reg/exp.good0000644000175000017500000000011705461100533013657 0ustar arnoldarnold1 gawk: reg/exp.awk:1: warning: exp argument 1e+06 is out of range Inf 1.64872 beebe/reg/exp-eq.good0000644000175000017500000000000705461100534014261 0ustar arnoldarnold1 8 27 beebe/reg/exp.in0000644000175000017500000000000005461100533013324 0ustar arnoldarnoldbeebe/reg/func.in0000644000175000017500000000000005461100534013464 0ustar arnoldarnoldbeebe/reg/func2.good0000644000175000017500000000017105461100534014101 0ustar arnoldarnoldgawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and (, or used in other expression context beebe/reg/log.in0000644000175000017500000000000005461100533013311 0ustar arnoldarnoldbeebe/reg/func2.in0000644000175000017500000000000005461100534013546 0ustar arnoldarnoldbeebe/reg/func.good0000644000175000017500000000007205461100534014017 0ustar arnoldarnoldgawk: reg/func.awk:1: fatal: function `dummy' not defined beebe/reg/exp.out0000644000175000017500000000017706707071765013566 0ustar arnoldarnold1 /a/sundown/export/home/0002/beebe/src/bwkawk/19990416/test/../a.out: exp result out of range source line number 1 1 1.64872 beebe/reg/func2.out0000644000175000017500000000020706707071765014001 0ustar arnoldarnold/a/sundown/export/home/0002/beebe/src/bwkawk/19990416/test/../a.out: can't read value of dummy; it's a function. source line number 2 beebe/reg/func.awk0000644000175000017500000000003105461100534013644 0ustar arnoldarnoldBEGIN { print dummy(1) } beebe/reg/func.out0000644000175000017500000000017406707071765013722 0ustar arnoldarnold/a/sundown/export/home/0002/beebe/src/bwkawk/19990416/test/../a.out: calling undefined function dummy source line number 1 beebe/eofsplit.ok0000644000175000017500000000000006254152123013606 0ustar arnoldarnoldbeebe/litoct.ok0000644000175000017500000000001106013743252013263 0ustar arnoldarnoldno match beebe/arrayparm.awk0000644000175000017500000000045506013302677014152 0ustar arnoldarnold# # Test program from: # # Date: Tue, 21 Feb 95 16:09:29 EST # From: emory!blackhawk.com!aaron (Aaron Sosnick) # BEGIN { foo[1]=1; foo[2]=2; bug1(foo); } function bug1(i) { for (i in foo) { bug2(i); delete foo[i]; print i,1,bot[1]; } } function bug2(arg) { bot[arg]=arg; } beebe/strftlng.awk0000644000175000017500000000046706345314776014035 0ustar arnoldarnold# test file from Paul Eggert, eggert@twinsun.com # modified for portability (%c doesn't cut it) BEGIN { BUFSIZ = 1024 simpleformat = format = "%m/%d/%y %H:%M:%S\n" clen = length(strftime(format, 0)) for (i = 1; i < BUFSIZ / clen + 1; i++) format = format simpleformat printf "%s", strftime(format, 0) } beebe/clsflnam.in0000644000175000017500000000002506254152070013565 0ustar arnoldarnoldline 1 line 2 line 3 beebe/ofmts.in0000644000175000017500000000001006407125120013104 0ustar arnoldarnold1.2 2.2 beebe/zeroflag.ok0000644000175000017500000000001006617041635013603 0ustar arnoldarnold 2--- 2 beebe/sclifin.ok0000644000175000017500000000007706444560347013442 0ustar arnoldarnoldgawk: sclifin.awk:7: fatal: attempt to use scalar `j' as array beebe/out3.ok0000644000175000017500000000001505461100535012660 0ustar arnoldarnoldYou blew it! beebe/mmap8k.in0000644000175000017500000002000006254152102013152 0ustar arnoldarnoldXXXXXXXX.com ALTERNET 9305 930528 1500.00 startup XXXXXXXX.com ALTERNET 9305 930624 94.38 Line-9305 XXXXXXXX.com ALTERNET 9306 930624 104.49 Line-9306 XXXXXXXX.com ALTERNET 9306 930624 649.16 Line-install XXXXXXXX.com ALTERNET 9306 930624 166.67 TCP-slip XXXXXXXX.com ALTERNET 9307 930624 104.49 Line-9307 XXXXXXXX.com ALTERNET 9307 930624 250.00 TCP-slip XXXXXXXX.com ALTERNET 9308 930701 250.00 TCP-slip XXXXXXXX.com ALTERNET 9308 930701 104.49 line-9308 XXXXXXXX.com PAYMENT 9307 930731 1500.00 1870 XXXXXXXX.com ALTERNET 9309 930801 250.00 TCP-slip XXXXXXXX.com ALTERNET 9309 930801 104.49 line-9309 XXXXXXXX.com INTEREST 9307 930801 22.50 XXXXXXXX.com CREDADJ 9308 930805 22.50 waive interest XXXXXXXX.com PAYMENT 9308 930820 1723.68 1982 XXXXXXXX.com ALTERNET 9310 930901 250.00 TCP-slip XXXXXXXX.com ALTERNET 9310 930901 104.49 line-9310 XXXXXXXX.com PAYMENT 9310 931001 708.98 2313 XXXXXXXX.com ALTERNET 9311 931001 250.00 TCP-slip XXXXXXXX.com ALTERNET 9311 931001 104.49 line-9311 XXXXXXXX.com INTEREST 9309 931001 5.32 XXXXXXXX.com CREDADJ 9310 931007 5.32 waive int-9309 XXXXXXXX.com ALTERNET 9312 931101 250.00 TCP-slip XXXXXXXX.com ALTERNET 9312 931101 104.49 line-9312 XXXXXXXX.com PAYMENT 9311 931120 354.49 002701 XXXXXXXX.com ALTERNET 9401 931201 250.00 TCP-slip XXXXXXXX.com ALTERNET 9401 931201 104.49 line-9401 XXXXXXXX.com PAYMENT 9312 931218 354.49 2884 XXXXXXXX.com ALTERNET 9402 940101 250.00 TCP-slip XXXXXXXX.com ALTERNET 9402 940101 104.49 line-9402 XXXXXXXX.com INTEREST 9312 940101 5.32 XXXXXXXX.com PAYMENT 9401 940122 354.49 3084 XXXXXXXX.com ALTERNET 9403 940201 250.00 TCP-slip XXXXXXXX.com ALTERNET 9403 940201 104.49 line-9403 XXXXXXXX.com INTEREST 9401 940201 5.40 XXXXXXXX.com PAYMENT 9402 940207 354.49 3140 XXXXXXXX.com CREDADJ 9402 940211 5.32 interest-9402 XXXXXXXX.com CREDADJ 9402 940211 5.40 interest-9403 XXXXXXXX.com ALTERNET 9404 940301 250.00 TCP-slip XXXXXXXX.com ALTERNET 9404 940301 104.49 line-9404 XXXXXXXX.com INTEREST 9402 940301 5.32 XXXXXXXX.com PAYMENT 9403 940310 354.49 003307 XXXXXXXX.com PAYMENT 9403 940324 354.49 3446 XXXXXXXX.com ALTERNET 9405 940401 250.00 TCP-slip XXXXXXXX.com ALTERNET 9405 940401 104.49 line-9405 XXXXXXXX.com ALTERNET 9406 940501 250.00 TCP-slip XXXXXXXX.com ALTERNET 9406 940501 104.49 line-9406 XXXXXXXX.com INTEREST 9404 940501 5.40 XXXXXXXX.com PAYMENT 9405 940509 359.81 003819 XXXXXXXX.com ALTERNET 9407 940601 250.00 TCP-slip XXXXXXXX.com ALTERNET 9407 940601 104.49 line-9407 XXXXXXXX.com INTEREST 9405 940601 5.40 XXXXXXXX.com PAYMENT 9406 940603 354.49 004025 XXXXXXXX.com ALTERNET 9408 940701 250.00 TCP-slip XXXXXXXX.com ALTERNET 9408 940701 104.49 line-9408 XXXXXXXX.com INTEREST 9406 940701 5.48 XXXXXXXX.com PAYMENT 9407 940725 354.49 004350 XXXXXXXX.com ALTERNET 9409 940801 250.00 TCP-slip XXXXXXXX.com ALTERNET 9409 940801 104.49 line-9409 XXXXXXXX.com INTEREST 9407 940801 5.56 XXXXXXXX.com PAYMENT 9408 940808 354.49 004454 XXXXXXXX.com ALTERNET 9409 940811 0.00 startup XXXXXXXX.com EQUIPMENT 9408 940831 399.00 ATL6402-1 XXXXXXXX.com EQUIPMENT 9408 940831 2295.00 NBClassicPac-1 XXXXXXXX.com EQUIPMENT 9408 940831 1060.00 Syn35-1+ship XXXXXXXX.com ALTERNET 9410 940901 250.00 TCP-slip XXXXXXXX.com ALTERNET 9410 940901 104.49 line-9410 XXXXXXXX.com INTEREST 9408 940901 5.64 XXXXXXXX.com PAYMENT 9409 940906 354.49 004677 XXXXXXXX.com CREDADJ 9409 940921 124.95 TCP-slip-9409 XXXXXXXX.com CREDADJ 9409 940921 52.20 line-9409 XXXXXXXX.com CREDADJ 9410 940921 250.00 TCP-slip-9410 XXXXXXXX.com CREDADJ 9410 940921 104.49 line-9410 XXXXXXXX.com ALTERNET 9409 940921 397.50 TCP-56k-local recon XXXXXXXX.com ALTERNET 9409 940921 87.45 line-9409 recon XXXXXXXX.com ALTERNET 9410 940921 795.00 TCP-56k-local recon XXXXXXXX.com ALTERNET 9410 940921 174.90 line-9410 recon XXXXXXXX.com ALTERNET 9411 941001 795.00 TCP-56k-local XXXXXXXX.com ALTERNET 9411 941001 174.90 line-9411 XXXXXXXX.com INTEREST 9409 941001 54.06 XXXXXXXX.com PAYMENT 9410 941017 354.49 5026 XXXXXXXX.com ALTERNET 9412 941101 795.00 TCP-56k-local XXXXXXXX.com ALTERNET 9412 941101 174.90 line-9412 XXXXXXXX.com INTEREST 9410 941101 85.93 XXXXXXXX.com PAYMENT 9411 941114 969.90 005274 XXXXXXXX.com ALTERNET 9501 941201 795.00 TCP-56k-local XXXXXXXX.com ALTERNET 9501 941201 174.90 line-9501 XXXXXXXX.com INTEREST 9411 941201 87.22 XXXXXXXX.com PAYMENT 9412 941219 4723.90 5590 XXXXXXXX.com ALTERNET 9502 950101 795.00 TCP-56k-local XXXXXXXX.com ALTERNET 9502 950101 174.90 line-9502 XXXXXXXX.com INTEREST 9412 950101 32.22 XXXXXXXX.com PAYMENT 9501 950103 1893.11 5766 XXXXXXXX.com ALTERNET 9503 950201 795.00 TCP-56k-local-old XXXXXXXX.com ALTERNET 9503 950201 174.90 line-9503 XXXXXXXX.com INTEREST 9501 950201 18.85 XXXXXXXX.com PAYMENT 9502 950207 969.90 6044 XXXXXXXX.com ALTERNET 9504 950301 795.00 TCP-56k-local-old XXXXXXXX.com ALTERNET 9504 950301 174.90 line-9504 XXXXXXXX.com INTEREST 9502 950301 19.13 XXXXXXXX.com PAYMENT 9503 950307 969.90 6408 XXXXXXXX.com ALTERNET 9504 950316 3000.00 startup TCP-bt1-128k%5 XXXXXXXX.com PAYMENT 9503 950327 969.90 6594 XXXXXXXX.com ALTERNET 9505 950401 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9505 950401 556.60 line-9505 XXXXXXXX.com EQUIPMENT 9504 950410 1595.00 cisco2501-1 XXXXXXXX.com CREDADJ 9504 950417 503.50 TCP-56k-local XXXXXXXX.com CREDADJ 9504 950417 116.60 line-9504 XXXXXXXX.com ALTERNET 9504 950417 448.80 line-install XXXXXXXX.com ALTERNET 9504 950417 752.02 TCP-bt1-128k%5 recon XXXXXXXX.com ALTERNET 9504 950417 371.00 line-9504 recon XXXXXXXX.com PAYMENT 9504 950424 3000.00 6841 XXXXXXXX.com ALTERNET 9506 950501 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9506 950501 556.60 line-9506 XXXXXXXX.com PAYMENT 9505 950505 2049.86 6985 XXXXXXXX.com PAYMENT 9505 950531 3924.22 7179 XXXXXXXX.com ALTERNET 9507 950601 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9507 950601 556.60 line-9507 XXXXXXXX.com PAYMENT 9506 950607 1744.10 7232 XXXXXXXX.com ALTERNET 9508 950701 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9508 950701 556.60 line-9508 XXXXXXXX.com PAYMENT 9507 950705 1744.10 7641 XXXXXXXX.com ALTERNET 9509 950801 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9509 950801 556.60 line-9509 XXXXXXXX.com PAYMENT 9508 950803 1744.10 7914 XXXXXXXX.com ALTERNET 9510 950901 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9510 950901 556.60 line-9510 XXXXXXXX.com PAYMENT 9509 950905 1744.10 8203 XXXXXXXX.com ALTERNET 9511 951001 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9511 951001 556.60 line-9511 XXXXXXXX.com PAYMENT 9510 951003 1744.10 8508 XXXXXXXX.com ALTERNET 9512 951101 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9512 951101 556.60 line-9512 XXXXXXXX.com PAYMENT 9511 951103 2129.83 8837 XXXXXXXX.com ALTERNET 9601 951201 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9601 951201 556.60 line-9601 XXXXXXXX.com PAYMENT 9512 951204 2129.83 9131 XXXXXXXX.com ALTERNET 9602 960101 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9602 960101 556.60 line-9602 XXXXXXXX.com PAYMENT 9601 960103 1744.10 9456 XXXXXXXX.com ALTERNET 9603 960201 1187.50 TCP-bt1-128k%5.00 XXXXXXXX.com ALTERNET 9603 960201 556.60 line-9603 XXXXXXXX.com PAYMENT 9602 960205 1358.37 9834 beebe/getnr2tm.awk0000644000175000017500000000756506617613274013737 0ustar arnoldarnold#From dhw@gamgee.acad.emich.edu Sat Oct 31 22:54:07 1998 #Return-Path: #Received: from cssun.mathcs.emory.edu (cssun.mathcs.emory.edu [170.140.150.1]) # by amx.netvision.net.il (8.9.0.Beta5/8.8.6) with ESMTP id HAA08891 # for ; Sat, 31 Oct 1998 07:14:07 +0200 (IST) #Received: from mescaline.gnu.org (we-refuse-to-spy-on-our-users@mescaline.gnu.org [158.121.106.21]) by cssun.mathcs.emory.edu (8.7.5/8.6.9-940818.01cssun) with ESMTP id AAA14947 for ; Sat, 31 Oct 1998 00:14:32 -0500 (EST) #Received: from gamgee.acad.emich.edu (gamgee.acad.emich.edu [164.76.102.76]) # by mescaline.gnu.org (8.9.1a/8.9.1) with SMTP id AAA20645 # for ; Sat, 31 Oct 1998 00:17:54 -0500 #Received: by gamgee.acad.emich.edu (Smail3.1.29.1 #57) # id m0zZUKY-000IDSC; Sat, 31 Oct 98 00:16 CST #Message-Id: #Date: Sat, 31 Oct 98 00:16 CST #From: dhw@gamgee.acad.emich.edu (David H. West) #To: bug-gnu-utils@gnu.org #Subject: gawk 3.0.3 bug report #Cc: arnold@gnu.org #X-UIDL: 7474b825cff989adf38f13883d84fdd7 #Status: RO # #gawk version: 3.03 #System used: Linux, kernel 2.0.28, libc 5.4.33, AMD K5PR133 (i586 clone) #Remark: There seems to be at least one bug shown by the demo below. # There may also be a Dark Corner involving the value of NR in an # END block, a topic on which the info file is silent. In gawk # 3.0.3, NR often seems to have the least-surprise value in an # END block, but sometimes it doesn't - see example below. #Problem descr: the log below shows a case where: # a) (this may be a red herring) the output of the gawk script # is different depending on whether its input file is named on # the command line or catted to stdin, without any use of the # legitimate means which could produce this effect. # b) NR is clearly getting clobbered; I have tried to simplify # the 19-line script "awkerr1" below, but seemingly unrelated # changes, like shortening constant strings which appear only in # print statements, or removing unexecuted or irrelevant code, # cause the clobbering to go away. Some previous (larger) # versions of this code would clobber NR also when reading from # stdin, but I thought you'd prefer a shorter example :-). #Reproduce-By: using the gawk script "awkerr1", the contents of # which appear in the transcript below as the output of the # command "cat awkerr1". Comments following # were added # to the transcript later as explanation. #---------------------------------------------- Script started on Fri #Oct 30 20:04:16 1998 chipmunk:/ram0# ls -l a1 awkerr1 -rw-r--r-- 1 #root root 2 Oct 30 18:42 a1 -rwxr-xr-x 1 root root #389 Oct 30 19:54 awkerr1 chipmunk:/ram0# cat a1 #a1 contains #one printable char and a newline a chipmunk:/ram0# od -c xc a1 #0000000 0a61 # a \n #0000002 chipmunk:/ram0# cat a1 | awkerr1 #no surprises here #1 lines in 1 sec: 1 lines/sec; nlines=1 chipmunk:/ram0# awkerr1 a1 È #lines in 1 sec: 1 lines/sec; nlines=1 #?! first char is an uppercase #E-grave chipmunk:/ram0# awkerr1 a1 | od -N1 -xc 0000000 00c8 # 310 \0 #0000001 chipmunk:/ram0# cat awkerr1 #the apparent ^M's are not #actually in the file #!/usr/bin/awk -f function process(w) { if(w in ws) { printf " : found\n"; lc[p " " w]++; rc[w " " n]++; } } BEGIN {IGNORECASE=1; } /^/ {if(NR % 10 ==0)print "processing line " NR; process($1); nlines++; } END {p=w; w=n; n=""; if(w)process(w); t=1; print NR " lines in " t " sec: " NR+0 " lines/sec; nlines=" nlines; } #chipmunk:/ram0# exit Script done on Fri Oct 30 20:07:31 1998 #--------------------------------------------- # #-David West dhw@gamgee.acad.emich.edu # beebe/resplit.ok0000644000175000017500000000000206013765116013452 0ustar arnoldarnoldb beebe/rswhite.ok0000644000175000017500000000001606014276043013457 0ustar arnoldarnold< a b c d>