Remove test sub-directory.

This commit is contained in:
James Raynard 1998-03-10 19:28:47 +00:00
parent c0ecc864be
commit 3e77698b86
217 changed files with 1 additions and 4534 deletions

View file

@ -49,20 +49,9 @@ random.h
regex.c
regex.h
stamp-h.in
test/
vms/
In addition, doc/gawk.1 and doc/gawk.texi were renamed to awk.1 and awk.texi.
The test sub-directory has been left in, as, although not necessary to build
awk on FreeBSD, it will be useful to anyone changing the code. To use it,
do something like
cd /usr/src/contrib/awk
ln -s /path/to/new/awk gawk
cd test && make
NB It may also be necessary to do
chmod u+x poundbang fflush.sh
jraynard@freebsd.org

View file

@ -1,252 +0,0 @@
Thu May 15 12:49:08 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Release 3.0.3: Release tar file made.
Tue May 13 12:53:46 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (messages): more testing for OK failure on Linux.
Sun May 11 14:57:11 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (nondec): new test case.
* nondec.awk, nondec.ok: new files.
Sun May 11 07:07:05 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (prdupval): new test case.
* prdupval.awk, prdupval.in, prdupval.ok: new files.
Wed May 7 21:54:34 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (delarprm): new test case.
* delarprm.awk, delarprm.ok: new files.
Wed May 7 17:54:00 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (pid): several fixes from ghazi@caip.rutgers.edu.
Tue May 6 20:28:30 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (pipeio2): new test case.
* pipeio2.awk, pipeio2.ok, pipeio2.in: new files.
Sun Apr 20 12:22:52 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (clobber): new test case.
* clobber.awk, clobber.ok: new files.
Fri Apr 18 07:55:47 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* BETA Release 3.0.34: Release tar file made.
Tue Apr 15 05:57:29 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (pipeio1): new test case.
* pipeio1.awk, pipeio1.ok: new files.
Tue Mar 18 06:38:36 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (noparm): new test case.
* noparm.awk, noparm.ok: new files.
Fri Feb 21 06:30:18 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (reint): new test case.
* reint.awk, reint.in, reint.ok: new files.
Wed Feb 5 18:17:51 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (fnarydel): new test case.
* fnarydel.awk, fnarydel.ok: new files.
Sun Jan 19 17:06:18 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (nors): new test case.
* nors.ok: new file.
Sun Jan 19 17:06:18 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (intest): new test case.
* intest.awk, intest.ok: new files.
Wed Dec 25 11:25:22 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Release 3.0.2: Release tar file made.
Tue Dec 10 23:09:26 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Release 3.0.1: Release tar file made.
Thu Nov 7 09:12:20 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (splitvar): new test case.
* splitvar.awk, splitvar.in, splitvar.ok: new files.
Sun Nov 3 10:55:50 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (nlfldsep): new test case.
* nlfldsep.sh, nlfldsep.ok: new files.
Fri Oct 25 10:29:56 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (tradanch): new test case.
* tradanch.awk, tradanch.in, tradanch.ok: new files.
Thu Oct 17 21:22:05 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (back89): new test case.
* back89.in, back89.ok: new files.
Sun Oct 6 20:45:54 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (splitwht): new test case.
* splitwht.awk, splitwht.ok: new files.
Sun Sep 29 23:14:20 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (gsubtest): new test case.
* gsubtest.awk, gsubtest.ok: new files.
Fri Sep 20 11:58:40 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (prtoeval): new test case.
* prtoeval.awk, prtoeval.ok: new files.
Tue Sep 10 06:26:44 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (gsubasgn): new test case.
* gsubasgn.awk, gsubasgn.ok: new files.
Wed Aug 28 22:06:33 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* badargs.ok: updated output corresponding to change made to
main.c (see main ChangeLog).
Thu Aug 1 07:20:28 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (prt1eval): new test case.
* prt1eval.awk, prt1eval.ok: new files.
Mon Jul 22 22:06:10 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (eofsplit): new test case.
* eofsplit.awk, eofsplit.ok: new files.
Sun Jul 14 07:07:45 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (fldchgnf): new test case.
* fldchgnf.awk, fldchgnf.ok: new files.
Tue May 21 23:23:22 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (substr): new test case.
* substr.awk, substr.ok: new files.
Tue May 14 15:05:23 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (dynlj): new test case.
* dynlj.awk, dynlj.ok: new files.
Sun May 12 20:45:34 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Makefile.in (fnarray): new test case.
* fnarray.awk, fnarray.ok: new files.
Fri Mar 15 06:46:48 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (mmap8k): new test case.
* mmap8k.in, mmap8k.ok: new files.
Sun Mar 10 22:58:35 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* Makefile.in (tweakfld): new test case.
* tweakfld.in, tweakfld.awk, tweakfld.ok: new files.
Sun Mar 3 06:51:26 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* 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 <arnold@skeeve.atl.ga.us>
* ChangeLog created.

View file

@ -1,451 +0,0 @@
# Generated automatically from Makefile.in by configure.
# 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
CMP = cmp
srcdir = .
bigtest: basic unix-tests gawk.extensions
basic: msg swaplns messages argarray longwrds \
getline fstabplus compare arrayref rs fsrs rand \
fsbs negexp asgext anchgsub splitargv awkpath nfset reparse \
convfmt arrayparm paramdup nonl defref nofmtch litoct resplit \
rswhite prmarscl sclforin sclifin intprec childin noeffect \
numsubstr pcntplus prmreuse math fldchg fldchgnf reindops \
sprintfc backgsub tweakfld clsflnam mmap8k fnarray \
dynlj substr eofsplit prt1eval gsubasgn prtoeval gsubtest splitwht \
back89 tradanch nlfldsep splitvar intest nfldstr nors fnarydel \
noparms funstack clobber delarprm prdupval
unix-tests: poundbang fflush getlnhd pipeio1 pipeio2 strftlng pid
gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \
badargs strftime gensub gnureops reint nondec
extra: regtest inftest
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, although some differences'
@echo 'in floating point values are probably benign -- in particular,'
@echo 'some systems may omit a leading zero and the floating point'
@echo 'precision may lead to slightly different output in a few cases.'
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; } || \
{ { test -d /dev/fd || test -d /proc/self/fd; } && \
echo IT IS OK THAT THIS TEST FAILED; }
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 | 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; LANC=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 _$@
clean:
rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
distclean: clean
rm -f Makefile
maintainer-clean: distclean

View file

@ -1,451 +0,0 @@
# 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
CMP = cmp
srcdir = @srcdir@
VPATH = @srcdir@
bigtest: basic unix-tests gawk.extensions
basic: msg swaplns messages argarray longwrds \
getline fstabplus compare arrayref rs fsrs rand \
fsbs negexp asgext anchgsub splitargv awkpath nfset reparse \
convfmt arrayparm paramdup nonl defref nofmtch litoct resplit \
rswhite prmarscl sclforin sclifin intprec childin noeffect \
numsubstr pcntplus prmreuse math fldchg fldchgnf reindops \
sprintfc backgsub tweakfld clsflnam mmap8k fnarray \
dynlj substr eofsplit prt1eval gsubasgn prtoeval gsubtest splitwht \
back89 tradanch nlfldsep splitvar intest nfldstr nors fnarydel \
noparms funstack clobber delarprm prdupval
unix-tests: poundbang fflush getlnhd pipeio1 pipeio2 strftlng pid
gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \
badargs strftime gensub gnureops reint nondec
extra: regtest inftest
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, although some differences'
@echo 'in floating point values are probably benign -- in particular,'
@echo 'some systems may omit a leading zero and the floating point'
@echo 'precision may lead to slightly different output in a few cases.'
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; } || \
{ { test -d /dev/fd || test -d /proc/self/fd; } && \
echo IT IS OK THAT THIS TEST FAILED; }
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 | 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; LANC=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 _$@
clean:
rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
distclean: clean
rm -f Makefile
maintainer-clean: distclean

View file

@ -1,18 +0,0 @@
Mon 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.

View file

@ -1 +0,0 @@
{ gsub(/^[ ]*/, "", $0) ; print }

View file

@ -1 +0,0 @@
This is a test, this is only a test.

View file

@ -1 +0,0 @@
This is a test, this is only a test.

View file

@ -1,14 +0,0 @@
BEGIN {
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 "\""
}

View file

@ -1 +0,0 @@
this is a simple test file

View file

@ -1,9 +0,0 @@
here we have 3 arguments
which are
gawk
./argarray.in
-
Environment variable TEST=
and the current input file is called ""
in main loop, this input file is known as "./argarray.in"
in main loop, this input file is known as "-"

View file

@ -1,4 +0,0 @@
BEGIN {
for (i = 0; i < ARGC; i++)
printf("ARGV[%d] = %s\n", i, ARGV[i])
}

View file

@ -1,4 +0,0 @@
ARGV[0] = gawk
ARGV[1] = -x
ARGV[2] = -y
ARGV[3] = abc

View file

@ -1,21 +0,0 @@
#
# 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;
}

View file

@ -1 +0,0 @@
gawk: arrayparm.awk:18: fatal: attempt to use array `foo' in a scalar context

View file

@ -1,13 +0,0 @@
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
}

View file

@ -1,2 +0,0 @@
1
1

View file

@ -1 +0,0 @@
{ print $3; $4 = "a"; print }

View file

@ -1,3 +0,0 @@
1 2 3
1
1 2 3 4

View file

@ -1,6 +0,0 @@
3
1 2 3 a
1 a
3
1 2 3 a

View file

@ -1 +0,0 @@
Found it.

View file

@ -1,2 +0,0 @@
a8b
a\8b

View file

@ -1 +0,0 @@
a8b

View file

@ -1,4 +0,0 @@
{
gsub( "\\\\", "\\\\")
print
}

View file

@ -1 +0,0 @@
\x\y\z

View file

@ -1 +0,0 @@
\\x\\y\\z

View file

@ -1,23 +0,0 @@
gawk: 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 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
Report bugs to bug-gnu-utils@prep.ai.mit.edu,
with a Cc: to arnold@gnu.ai.mit.edu

View file

@ -1 +0,0 @@
hi

View file

@ -1,98 +0,0 @@
BEGIN {
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 <emory!synet.net!imdave>
# 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 <set_field>, 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 <set_field>, 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 <Error reading address 0x804d006: No such file or directory>
# (gdb) print buf
# $2 = (char **) 0x37704
# (gdb) print *buf
# $3 = 0x804d000 <Error reading address 0x804d000: No such file or directory>
# (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

View file

@ -1 +0,0 @@
000801

View file

@ -1,12 +0,0 @@
#! /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 }

View file

@ -1,3 +0,0 @@
line 1
line 2
line 3

View file

@ -1,13 +0,0 @@
BEGIN {
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
}

View file

@ -1,4 +0,0 @@
0
1
0 1

View file

@ -1,5 +0,0 @@
2
zero
1
1
0 1

View file

@ -1,10 +0,0 @@
BEGIN {
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
}

View file

@ -1,3 +0,0 @@
a = 123.46
a = 123.456
a = 123.456

View file

@ -1 +0,0 @@
BEGIN { foo() }

View file

@ -1,2 +0,0 @@
gawk: defref.awk:2: warning: function `foo' called but never defined
gawk: defref.awk:1: fatal: function `foo' not defined

View file

@ -1,50 +0,0 @@
# From dragon!unagi.cis.upenn.edu!sjanet Tue Mar 25 17:12:20 1997
# Return-Path: <dragon!unagi.cis.upenn.edu!sjanet>
# Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1)
# id <m0w9eS4-000GWyC@skeeve.atl.ga.us>; 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 <bug-gnu-utils@prep.ai.mit.edu>; 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 <sjanet@unagi.cis.upenn.edu>
# 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

View file

@ -1 +0,0 @@
BEGIN { printf "%*sworld\n", -20, "hello" }

View file

@ -1 +0,0 @@
hello world

View file

@ -1,68 +0,0 @@
# Date: Sat, 30 Mar 1996 12:47:17 -0800 (PST)
# From: Charles Howes <chowes@grid.direct.ca>
# 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

View file

@ -1,16 +0,0 @@
1st
2nd
1st
2nd
1st
2nd
1st
2nd
1st
2nd
1st
2nd
1st
2nd
1st
2nd

View file

@ -1,16 +0,0 @@
#! /bin/sh
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}'
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat"}'|cat
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");close("/dev/stdout");print "2nd"|"cat"}'|cat
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"cat";close("cat")}'|cat
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort"}'|cat
../gawk 'BEGIN{print "1st";fflush("/dev/stdout");print "2nd"|"sort";close("sort")}'|cat

View file

@ -1 +0,0 @@
345

View file

@ -1,8 +0,0 @@
{
# print "0:", $0
gsub("aa", "+")
print "1:", $0
$3 = "<" $3 ">"
print "2:", $0
print "2a:" "%" $1 "%" $2 "%" $3 "%" $4 "%" $5
}

View file

@ -1 +0,0 @@
aa aab c d e f

View file

@ -1,3 +0,0 @@
1: + +b c d e f
2: + +b <c> d e f
2a:%+%+b%<c>%d%e

View file

@ -1 +0,0 @@
{ OFS = ":"; $2 = ""; print $0; print NF }

View file

@ -1 +0,0 @@
a b c d

View file

@ -1,2 +0,0 @@
a::c:d
4

View file

@ -1,7 +0,0 @@
function foo(N) {
return 0
}
BEGIN {
Num = foo[c]
}

View file

@ -1 +0,0 @@
gawk: fnarray.awk:5: fatal: attempt to use function `foo' as array

View file

@ -1,60 +0,0 @@
#!/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"
}

View file

@ -1,27 +0,0 @@
first 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

View file

@ -1 +0,0 @@
1\2

View file

@ -1 +0,0 @@
1 2

View file

@ -1,8 +0,0 @@
BEGIN {
RS=""; FS="\n";
ORS=""; OFS="\n";
}
{
split ($2,f," ")
print $0;
}

View file

@ -1,7 +0,0 @@
a b
c d
e f
1 2
3 4
5 6

View file

@ -1,5 +0,0 @@
a b
c d
e f1 2
3 4
5 6

View file

@ -1,2 +0,0 @@
BEGIN { FS = "\t+" }
{ print $1, $2 }

View file

@ -1 +0,0 @@
1 2

View file

@ -1,977 +0,0 @@
### ====================================================================
### @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
### <at>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) "<BR>")
}
html_end_toc()
html_begin_issue()
print_line(prefix(2) Journal "<BR>")
}
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}/, "\\&agrave;", s)
gsub(/{\\'a}/, "\\&aacute;", s)
gsub(/{\\[\^]a}/,"\\&acirc;", s)
gsub(/{\\~a}/, "\\&atilde;", s)
gsub(/{\\\"a}/, "\\&auml;", s)
gsub(/{\\aa}/, "\\&aring;", s)
gsub(/{\\ae}/, "\\&aelig;", s)
gsub(/{\\c{c}}/,"\\&ccedil;", s)
gsub(/{\\\e}/, "\\&egrave;", s)
gsub(/{\\'e}/, "\\&eacute;", s)
gsub(/{\\[\^]e}/,"\\&ecirc;", s)
gsub(/{\\\"e}/, "\\&euml;", s)
gsub(/{\\\i}/, "\\&igrave;", s)
gsub(/{\\'i}/, "\\&iacute;", s)
gsub(/{\\[\^]i}/,"\\&icirc;", s)
gsub(/{\\\"i}/, "\\&iuml;", s)
# ignore eth and thorn
gsub(/{\\~n}/, "\\&ntilde;", s)
gsub(/{\\\o}/, "\\&ograve;", s)
gsub(/{\\'o}/, "\\&oacute;", s)
gsub(/{\\[\^]o}/, "\\&ocirc;", s)
gsub(/{\\~o}/, "\\&otilde;", s)
gsub(/{\\\"o}/, "\\&ouml;", s)
gsub(/{\\o}/, "\\&oslash;", s)
gsub(/{\\\u}/, "\\&ugrave;", s)
gsub(/{\\'u}/, "\\&uacute;", s)
gsub(/{\\[\^]u}/,"\\&ucirc;", s)
gsub(/{\\\"u}/, "\\&uuml;", s)
gsub(/{\\'y}/, "\\&yacute;", s)
gsub(/{\\\"y}/, "\\&yuml;", s)
# Now do the same for upper-case accents
gsub(/{\\\A}/, "\\&Agrave;", s)
gsub(/{\\'A}/, "\\&Aacute;", s)
gsub(/{\\[\^]A}/, "\\&Acirc;", s)
gsub(/{\\~A}/, "\\&Atilde;", s)
gsub(/{\\\"A}/, "\\&Auml;", s)
gsub(/{\\AA}/, "\\&Aring;", s)
gsub(/{\\AE}/, "\\&AElig;", s)
gsub(/{\\c{C}}/,"\\&Ccedil;", s)
gsub(/{\\\e}/, "\\&Egrave;", s)
gsub(/{\\'E}/, "\\&Eacute;", s)
gsub(/{\\[\^]E}/, "\\&Ecirc;", s)
gsub(/{\\\"E}/, "\\&Euml;", s)
gsub(/{\\\I}/, "\\&Igrave;", s)
gsub(/{\\'I}/, "\\&Iacute;", s)
gsub(/{\\[\^]I}/, "\\&Icirc;", s)
gsub(/{\\\"I}/, "\\&Iuml;", s)
# ignore eth and thorn
gsub(/{\\~N}/, "\\&Ntilde;", s)
gsub(/{\\\O}/, "\\&Ograve;", s)
gsub(/{\\'O}/, "\\&Oacute;", s)
gsub(/{\\[\^]O}/, "\\&Ocirc;", s)
gsub(/{\\~O}/, "\\&Otilde;", s)
gsub(/{\\\"O}/, "\\&Ouml;", s)
gsub(/{\\O}/, "\\&Oslash;", s)
gsub(/{\\\U}/, "\\&Ugrave;", s)
gsub(/{\\'U}/, "\\&Uacute;", s)
gsub(/{\\[\^]U}/, "\\&Ucirc;", s)
gsub(/{\\\"U}/, "\\&Uuml;", s)
gsub(/{\\'Y}/, "\\&Yacute;", s)
gsub(/{\\ss}/, "\\&szlig;", s)
# Others not mentioned in Flynn's book
gsub(/{\\'\\i}/,"\\&iacute;", s)
gsub(/{\\'\\j}/,"j", s)
}
return (s)
}
function html_begin_issue()
{
print_line("")
print_line(prefix(2) "<HR>")
print_line("")
print_line(prefix(2) "<H1>")
print_line(prefix(3) "<A NAME=\"" html_label() "\">")
}
function html_begin_pages()
{
return ((HTML && (BIBFILEURL != "")) ? ("<A HREF=\"" BIBFILEURL "#" Citation_label "\">") : "")
}
function html_begin_pre()
{
In_PRE = 1
print_line("<PRE>")
}
function html_begin_title()
{
return ((HTML && (Url != "")) ? ("<A HREF=\"" 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) "</A>")
print_line(prefix(2) "</H1>")
}
function html_end_pages()
{
return ((HTML && (BIBFILEURL != "")) ? "</A>" : "")
}
function html_end_pre()
{
if (In_PRE)
{
print_line("</PRE>")
In_PRE = 0
}
}
function html_end_title()
{
return ((HTML && (Url != "")) ? "</A>" : "")
}
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 -> <TAG>arg</TAG>
arg = "<" Font_decl_map[control_word] ">" arg "</" Font_decl_map[control_word] ">"
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 -> <TAG>arg</TAG>
arg = "<" Font_cmd_map[control_word] ">" arg "</" Font_cmd_map[control_word] ">"
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 "<!-- WARNING: Do NOT edit this file. It was converted from -->"
print "<!-- BibTeX format to HTML by journal-toc.awk version " VERSION_NUMBER " " VERSION_DATE " -->"
print "<!-- on " DATE " -->"
print "<!-- for " PERSONAL_NAME " (" USER "@" HOSTNAME ") -->"
print ""
print ""
print "<!DOCTYPE HTML public \"-//IETF//DTD HTML//EN\">"
print ""
print "<HTML>"
print prefix(1) "<HEAD>"
print prefix(2) "<TITLE>"
print prefix(3) Journal
print prefix(2) "</TITLE>"
print prefix(2) "<LINK REV=\"made\" HREF=\"mailto:" USER "@" HOSTNAME "\">"
print prefix(1) "</HEAD>"
print ""
print prefix(1) "<BODY>"
}
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) "<H1>"
print prefix(3) "Table of contents for issues of " Journal
print prefix(2) "</H1>"
print HTML_TOC
}
function html_toc_entry()
{
HTML_TOC = HTML_TOC " <A HREF=\"#" html_label() "\">"
HTML_TOC = HTML_TOC vol_no_month_year()
HTML_TOC = HTML_TOC "</A><BR>" "\n"
}
function html_trailer()
{
html_end_pre()
print prefix(1) "</BODY>"
print "</HTML>"
}
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(/&/,"\\&amp;",s) # NB: this one MUST be first
gsub(/</,"\\&lt;",s)
gsub(/>/,"\\&gt;",s)
gsub(/\"/,"\\&quot;",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(/>/, "\\&gt;", s)
gsub(/</, "\\&lt;", s)
gsub(/"/, "\\&quot;", s)
}
gsub(/[$][$]/,"$$",s) # change display math to triple dollars for split
n = split(s,parts,/[$]/)# split into non-math (odd) and math (even) parts
s = ""
for (k = 1; k <= n; ++k) # unbrace non-math part, leaving math mode intact
s = s ((k > 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(/\\&/,"\\&amp;",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(/\\&/,"\\&amp;",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 ? ("<STRONG>" value "</STRONG>") : value)
}

View file

@ -1,206 +0,0 @@
%%% ====================================================================
%%% 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 <at>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.",
}

View file

@ -1,7 +0,0 @@
BEGIN { 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") }

View file

@ -1,2 +0,0 @@
a b c a b c a b c
a b c a b c a b c

View file

@ -1,4 +0,0 @@
3 = <gawk>, 2 = <test>, 1 = <this>
a b c a BB c a b c
a b CC a b CC a b CC
DON'T PANIC

View file

@ -1 +0,0 @@
BEGIN { while( getline > 0) { print } }

View file

@ -1,2 +0,0 @@
BEGIN { while( getline > 0) { print } }
BEGIN { while( getline > 0) { print } }

View file

@ -1,10 +0,0 @@
BEGIN { pipe = "cat <<EOF\n"
pipe = pipe "select * from user\n"
pipe = pipe " where Name = 'O\\'Donell'\n"
pipe = pipe "EOF\n"
while ((pipe | getline) > 0)
print
exit 0
}

View file

@ -1,2 +0,0 @@
select * from user
where Name = 'O\'Donell'

View file

@ -1,45 +0,0 @@
# 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" ~ /\<word/) print "test 6 ok (\\<)"
else print "test 6 failed (\\<)"
if ("foreword" !~ /\<word/) print "test 7 ok (\\<)"
else print "test 7 failed (\\<)"
if ("a word" ~ /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 (\\')"
}

View file

@ -1,17 +0,0 @@
test 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 (\')

View file

@ -1,13 +0,0 @@
# 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("") }

View file

@ -1,4 +0,0 @@
gawk: 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

View file

@ -1,8 +0,0 @@
BEGIN {
str = "abc"; gsub("b+", "FOO", str); print str
str = "abc"; gsub("x*", "X", str); print str
str = "abc"; gsub("b*", "X", str); print str
str = "abc"; gsub("c", "X", str); print str
str = "abc"; gsub("c+", "X", str); print str
str = "abc"; gsub("x*$", "X", str); print str
}

View file

@ -1,6 +0,0 @@
aFOOc
XaXbXcX
XaXcX
abX
abX
abcX

View file

@ -1,8 +0,0 @@
BEGIN {
IGNORECASE=1
FS="[^a-z]+"
}
{
for (i=1; i<NF; i++) printf "%s, ", $i
printf "%s\n", $NF
}

View file

@ -1,2 +0,0 @@
this is handled ok
This is Not hanDLed Well

View file

@ -1,2 +0,0 @@
this, is, handled, ok
This, is, Not, hanDLed, Well

View file

@ -1 +0,0 @@
xz

View file

@ -1,5 +0,0 @@
BEGIN {
x = 100
do { y = x ; x *= 1000; print x,y } while ( y != x )
print "loop terminated"
}

View file

@ -1,105 +0,0 @@
100000 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

View file

@ -1,4 +0,0 @@
BEGIN {
bool = ((b = 1) in c);
print bool, b # gawk-3.0.1 prints "0 "; should print "0 1"
}

View file

@ -1 +0,0 @@
0 1

View file

@ -1 +0,0 @@
BEGIN { printf "%.10d:%.10x\n", 5, 14 }

View file

@ -1 +0,0 @@
0000000005:000000000e

View file

@ -1 +0,0 @@
BEGIN { print "Found it." }

View file

@ -1 +0,0 @@
{ if (/a\52b/) print "match" ; else print "no match" }

View file

@ -1 +0,0 @@
no match

View file

@ -1,20 +0,0 @@
# 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"
}

View file

@ -1,21 +0,0 @@
20 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

View file

@ -1,200 +0,0 @@
.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

View file

@ -1 +0,0 @@
{ print $2 > ("junk/" $1) }

View file

@ -1,10 +0,0 @@
BEGIN {
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)
}

Some files were not shown because too many files have changed in this diff Show more