[comp.unix.wizards] nawk & libraries of awk functions

stevens@hsi.UUCP (Richard Stevens) (10/28/88)

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@hsi.uu.net
           ... { uunet | yale } ! hsi ! stevens

alex@mks.UUCP (Alex White) (11/03/88)

In article <195@hsi86.hsi.UUCP>, stevens@hsi.UUCP (Richard Stevens) writes:
> Unfortunately, awk's -f command line option can only occur once, and
MKS's version of awk allows multiple -f options for just this reason.
It is *very* useful.