bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Emulating "include" in gawk?


From: Aharon Robbins
Subject: Re: Emulating "include" in gawk?
Date: Sun, 10 Apr 2011 21:07:20 +0300

In article <address@hidden> you write:
>Is there an idiom or convention for emulating an include statement, wherein
>outside library code is brought into a gawk program?

The only standard mechanism is the use of multiple -f options on
the command line.

> I know it isn't posix, but the two features that hold me back from using
> awk all the time are the lack of a library system

Gawk extends multiple -f with the AWKPATH environment variable.

The development version of gawk has @include built-in.

>and the lack of a strict option (like "set -u" in shell).

Gawk has a --lint option; you may use --lint=fatal to cause lint errors
to kill your program.

>But maybe there are somewhat standard workarounds.

Nothing other than what I've mentioned.

>Oh -- I don't want to use another different system that I have to install and
>track like "igawk" or whatever it is.  

igawk is automatically installed when gawk is.

But it sounds like you will be happier if you just move to perl or some
other language.

HTH,

Arnold
-- 
Aharon (Arnold) Robbins                         arnold AT skeeve DOT com
P.O. Box 354            Home Phone: +972  8 979-0381
Nof Ayalon              Cell Phone: +972 50  729-7545
D.N. Shimshon 99785     ISRAEL



reply via email to

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