* Problems with nawk/gawk in new(?) Digital UNIX
@ 1996-11-27 5:00 Sean Lane
1996-12-03 5:00 ` Henk vd Langenberg
0 siblings, 1 reply; 2+ messages in thread
From: Sean Lane @ 1996-11-27 5:00 UTC (permalink / raw)
Yesterday I received a new AlphaStation 500/333 running (I assume) the latest
Digital UNIX (uname -a output gives OSF1 node V4.0 464 alpha) and comes with
the Common Desktop Environment.
Since installing this machine, I noticed that one of my cron jobs
failed last night (a nawk script). Further investigation revealed that
changing the field seperator to '=' (with {FS="="} ), does not work. It
ignores the new field seperator specification and just uses the default
tab and space seperators.
e.g.
echo "physical memory = 128.00 megabytes." | nawk '{FS="="} {print $2}'
will give the output :-
memory
instead of :-
128.00 megabytes.
which is the expected output (and which is produced on earlier versions of
Digital UNIX). This also fails if you use gawk instead of nawk. However,
it works if you use awk! I know that in REAL UNIX nawk is supposed to
replace awk (and in some cases it is linked so that they are one and
the same), so why is it that Digital has two seperate programs still?
I have worked around the problem by copying the older (working) versions
of nawk and gawk to the new machine since we have many scripts running using
nawk.
Just thought someone might want to know.
Sean A Lane.
___________CERN - European Laboratory for Particle Physics__________
ENT - NOMAD Experiment
____________________________________________________________________
Email : sean.lane@cern.ch
Snail mail : CERN,
Case Postale 6,
CH-1211-Geneve,23,
Switzerland,
Phone : + (41 22) 767 8987 (x78987)
____________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problems with nawk/gawk in new(?) Digital UNIX
1996-11-27 5:00 Problems with nawk/gawk in new(?) Digital UNIX Sean Lane
@ 1996-12-03 5:00 ` Henk vd Langenberg
0 siblings, 0 replies; 2+ messages in thread
From: Henk vd Langenberg @ 1996-12-03 5:00 UTC (permalink / raw)
Sean Lane wrote:
>
> Yesterday I received a new AlphaStation 500/333 running (I assume) the latest
> Digital UNIX (uname -a output gives OSF1 node V4.0 464 alpha) and comes with
> the Common Desktop Environment.
>
> Since installing this machine, I noticed that one of my cron jobs
> failed last night (a nawk script). Further investigation revealed that
> changing the field seperator to '=' (with {FS="="} ), does not work. It
> ignores the new field seperator specification and just uses the default
> tab and space seperators.
>
> e.g.
>
> echo "physical memory = 128.00 megabytes." | nawk '{FS="="} {print $2}'
>
It works fine if you say (which is in fact better):
echo "physical memory = 128.00 megabytes." | nawk 'BEGIN{FS="="}{print
$2}'
Henk.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Henk van de Langenberg, Eindhoven University of Technology =
= CC 1.91, P.O. Box 513, 5600 MB Eindhoven, The Netherlands =
= E-mail: rchenk@urc.tue.nl, TEL/FAX: +31 40 2474533/2434438 =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Reporter (to Indira Gandhi): =
= Mr Gandhi, what do you think of Western Civilization? =
= Gandhi: I think it would be a good idea. =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-12-03 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-11-27 5:00 Problems with nawk/gawk in new(?) Digital UNIX Sean Lane
1996-12-03 5:00 ` Henk vd Langenberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox