From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078701111568.tru64-unix-managers.marc@archive.invalid> From: Pat Wilson Date: Thu, 19 Mar 1998 18:14:21 +0000 To: tru64-unix-managers Subject: awk weirdness on DU X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078701111568 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; j0; 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