Not in this case, no. The format of awk is

        awk 'program' files
        awk -f prgm files

What I could do instead is

        u=/tmp/$0$pid$apid$0
        cat > $u <<\END
        program
        END
        awk -f $u $*
        rm $u

but I'd rather not go that way to avoid possible collisions.

Here's another problem. The error check function cats to [1=2]. However, instead of going to standard output, it makes a file [1=2] and writes the message there. How do I fix this?

On Dec 11, 2007, at 8:32 AM, roger peppe wrote:

a reason to use here files? :-)

On Dec 1, 2007 7:09 PM, Martin Neubauer <[EMAIL PROTECTED]> wrote:
Apparrently in quoted strings each character (rune, actually) constitutes one token. The lexical scanner only holds NTOK (==8192) tokens at a time and sam and wc convince me you have a 8555 byte string you pass to awk. You should probably put the awk stuff into a separate file eg.awk and just do `awk -f eg.awk $*' in eg (cf. chem(1) ). You might have to fiddle with where
you put things, but that seems to be the easiest way out.

        Martin


* Pietro Gagliardi ([EMAIL PROTECTED]) wrote:
Run /n/sources/contrib/pietro/eg (a work-in-progress troff
preprocessor for graphs of equations). You get the error described
above on a line that contains simply "else". What happened?


Reply via email to