[Top][All Lists]

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

Re: solaris "nawk" fixes edit-pr awk: syntax error

From: Mel Hatzis
Subject: Re: solaris "nawk" fixes edit-pr awk: syntax error
Date: Mon, 20 May 2002 11:39:52 -0700
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.8) Gecko/20020206

Milan Zamazal wrote:
"dm" == doug mildram <address@hidden> writes:

    dm> MINOR suggestion: no harm in littering /tmp with epNNNN files.
    dm>      around line 120 in edit-pr I'm changing
    dm> #trap 'rm -f $new $new.old $change_msg $fixfil ; exit 0' 0
    dm>                                     changing to
    dm> trap 'rm -f       $new.old $change_msg $fixfil ; exit 0' 0

Thanks for the suggestion.  It's a good idea, but I removed $new only
from the second trap (error signals).

Frankly, I don't know what `trap ... 0' is (no /bin/sh manual here
around).  If any /bin/sh guru knows, please enlighten me.

The 'trap' command as used above basically let's the shell perform
an action (in this case the 'rm') when it exits - using '0' as the
second argument means the trap is executed for both normal exits as
well as interrupts.

The use of single quotes means variable and command substitution
of the command is done when the trap is executed rather than when
the trap is set.

An excellent resource for additional information is O'Reilly's
'Unix Power Tools' by Peek, O'Reilly and Loukides.

    dm> MAJOR FIX: for solaris  diff-prs   ....change awk to nawk.

Well, there sometimes occur Solaris compatibility bugs.  They are
usually unpleasant bugs, since they occur only on certain Solaris
versions.  I am sorry, but I rather spend my spare time fixing bugs
present on free systems (such as GNU/Linux, GNU/HURD or free versions of
BSD), I hope you understand it.  If someone submits reasonable
compatibility patches, I'll incorporate it, of course.

Perhaps you could conditionally set an 'awk' variable based on
the output of 'uname -sr' in this case.

Mel Hatzis
Juniper Networks, Inc.

reply via email to

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