[3271] in testers
sparc 8.1.4: /usr/bin/awk fails to match()
daemon@ATHENA.MIT.EDU (John Hawkinson)
Thu Jun 19 14:54:22 1997
Date: Thu, 19 Jun 1997 14:53:54 -0400
To: testers@MIT.EDU
From: John Hawkinson <jhawk@MIT.EDU>
Solaris apparently ships with at least 3 different versions of awk:
bobbi-harlow# ls -l /usr/bin/{n,}awk /usr/{xcu4,xpg4}/bin/awk
/usr/xcu4/bin/awk: No such file or directory
-r-xr-xr-x 1 bin bin 104036 May 3 1996 /usr/bin/awk
-r-xr-xr-x 1 bin bin 166200 May 2 1996 /usr/bin/nawk
-r-xr-xr-x 1 bin bin 108936 May 2 1996 /usr/xpg4/bin/awk
With peculiar manpage seperation and overlap:
---cut/3
NAME
awk - pattern scanning and processing language
SYNOPSIS
/usr/bin/awk [ -f progfile ] [ -Fc ] [ 'prog' ] [ parameters
]
[ filename...]
/usr/xpg4/bin/awk [ -F ERE ] [ -v assignment
'program' | -f progfile [ argument ... ]
AVAILABILITY
/usr/bin/awk
SUNWesu
SUNWxcu4
/usr/xcu4/bin/awk
SUNWxcu4
---cut
NAME
nawk - pattern scanning and processing language
SYNOPSIS
/usr/bin/nawk [ -F ERE ] [ -v assignment ]
'program' | -f progfile argument ... ]
/usr/xpg4/bin/awk [ -F ERE ] [ -v assignment
'program' | -f progfile [ argument ... ]
AVAILABILITY
SUNWesu
/usr/xpg4/bin/awk
SUNWxcu4
---cut
It seems odd that /usr/xpg4/bin/awk is ostensibly covered by
both awk manpages. It seems even more odd given that
/usr/xcu4/bin/awk does not exist. The packages in question
are all installed, however:
bobbi-harlow# pkginfo | egrep 'SUNWesu|SUNWxcu4'
system SUNWesu Extended System Utilities
system SUNWxcu4 XCU4 Utilities
system SUNWxcu4t XCU4 make and sccs utilities
bobbi-harlow# pkginfo -l SUNWxcu4
PKGINST: SUNWxcu4
NAME: XCU4 Utilities
CATEGORY: system
ARCH: sparc
VERSION: 11.5.1,REV=96.05.02.21.09
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: utilities providing conformance with XCU4 specifications
PSTAMP: bread960502211415
INSTDATE: Sep 03 1996 12:39
HOTLINE: Please contact your local service provider
STATUS: completely installed
FILES: 41 installed pathnames
3 shared pathnames
8 linked files
3 directories
29 executables
1775 blocks used (approx)
pkginfo doesn't have a mechanism for saying what those installed
files *are*, of course (duh...).
So something seems broken there.
Anyhow, the awk(1) page states:
/usr/xpg4/bin/awk is described on the nawk(1) manual page.
/usr/bin/awk scans each input filename for lines that match
...
And makes no further mention of xcu4.
Anyhow, the USAGE section eventually states:
Other built-in functions include:
...
match(s, re)
returns the position in string s where the regular
expression re occurs, or 0 if it does not occur at
all.
bobbi-harlow# echo 1 | /usr/bin/awk '{print match("abc", /b/)}'
awk: syntax error near line 1
awk: illegal statement near line 1
bobbi-harlow# echo 1 | /usr/bin/nawk '{print match("abc", /b/)}'
2
bobbi-harlow# echo 1 | /usr/xpg4/bin/awk '{print match("abc", /b/)}'
2
bobbi-harlow#
Other string functions all seem to work.
--jhawk