* Problem with Gawk
@ 1995-03-29 10:17 msdc!beth
0 siblings, 0 replies; only message in thread
From: msdc!beth @ 1995-03-29 10:17 UTC (permalink / raw)
To: tru64-unix-managers
Hi folks!
I wrote in January describing a bug in awk under OSF/1 version 3.0.
In certain circumstances, awk didn't give correct results. You were
most helpful; confirming that it was in fact a bug and suggesting
gawk (or mawk).
I've just recently been able to get back to this project and unfortunately
I've also discovered some weird behavior in gawk. I'm assuming this is
a bug but I'd be open to any explanations to the contrary. The version
I'm using is 2.14, patchlevel 1.
Under the following set of circumstances, gawk simply returns a
"Usage" message:
Example:
/bin/ps -e -o pid,command | gawk '{ if ($2 == "rlogind") print $1 }'
This example won't run on our Alpha 4000/610. After trying many examples
designed to specifically diagnose the problem, I think the problem occurs only
when all of the following are true: (a) you are using the "gawk 'script'"
syntax (i.e. not using the -f option), (b) the only statement in the script
is an action statement with no pattern statement, (c) there is an "=" sign
in the action statement.
/bin/ps -e -o pid,command | gawk '{ if ($2 > 0) print $1 }'
works (no "=" sign).
/bin/ps -e -o pid,command | gawk '{ if ($2 == "rlogind") print $1 } END { print "ending script." '
works (the action statement is not the only one in the script).
Although this seems like quite a narrow set of circumstances, it's amazing
how many occasions we have to use processing like this. As a matter of fact,
this example is straight out of DEC's startup script for the networking
programs (rc3.d/S19nfs).
Does anyone know if this is a known problem? If so, is there a patch?
Is this the latest version of gawk? This is the version that was installed
with the OSF/1 3.2 OS.
Thanks for your input.
Beth Sewell (beth@msdc.com)
Medical Systems Development Corporation Atlanta, GA
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-03-29 10:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-03-29 10:17 Problem with Gawk msdc!beth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox