* awk weirdness on DU
@ 1998-03-19 18:14 Pat Wilson
0 siblings, 0 replies; only message in thread
From: Pat Wilson @ 1998-03-19 18:14 UTC (permalink / raw)
To: tru64-unix-managers
I've trying to run a program containing a rather complex awk script (I
didn't write it, so I can't really explain how it's doing what it does).
Said script works on AIX, HPUX, and IRIX, but not on DU (3.2G _or_ 4.0+).
Are there any known differences between Digital's awk and everyone else's?
Is POSIX biting me again?
The awk piece is:
awk 'BEGIN { FS="#" ; RS=">" }
{ i=0 ; printf "%s", $1
for (j=3; j<NF; j+=2)
{ for (k=i; k>0; k--)
{ if ($j > a[k]) break
a[k+1]=a[k] ; n[k+1]=n[k] }
i++ ; k++ ; a[k]=$j ; n[k]=$(j+1) }
for (j=1; j<=i; j++) printf " %s %s", a[j], n[j]
printf "\n" }'
The file it's processesing is of the form
>northstar.dartmouth.edu #Dartmouth College, Project Northstar
129.170.16.43 #cygnusx1.dartmouth.edu
129.170.16.205 #beehive.dartmouth.edu
129.170.24.37 #andromeda.dartmouth.edu
129.170.24.115 #horsehead.dartmouth.edu
Expected output is
northstar.dartmouth.edu 129.170.16.205 beehive.dartmouth.edu 129.170.16.43 cygnusx1.dartmouth.edu 129.170.24.115 horsehead.dartmouth.edu 129.170.24.37 andromeda.dartmouth.edu
but DU gives me
northstar.dartmouth.edu andromeda.dartmouth.edu
129.170.24.115 horsehead.dartmouth.edu
cygnusx1.dartmouth.edu
129.170.16.205 beehive.dartmouth.edu
129.170.24.37
Any ideas?
Thanks.
Pat Wilson
paw@dartmouth.edu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-03-19 18:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-19 18:14 awk weirdness on DU Pat Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox