nawk & libraries of awk functions

Richard Stevens stevens at hsi.UUCP
Fri Oct 28 11:01:29 AEST 1988


After becoming addicted to the new version of awk (nawk), and
especially its user functions, I've found myself copying handy
functions from one awk script to another.  What I'd like is some way
to build a library of these useful awk functions and be able to get
to them, without having to copy the source code around.
Unfortunately, awk's -f command line option can only occur once, and
there's nothing like the -l flag that we all know from cc.  John
Bentley had a "Programming Pearls" article in the CACM in July 1985
on nawk subroutine libraries, but he never touched on this issue.  I
can think of ways to handle this using existing tools (making nawk a
shell script that always invokes m4, and using the m4 include()
facility, for example), but I was wondering if anyone had any other
ideas, or if I'm missing something obvious ??

	Richard Stevens
	Health Systems International, New Haven, CT
	   stevens at hsi.uu.net
           ... { uunet | yale } ! hsi ! stevens



More information about the Comp.unix.wizards mailing list