There is not just one
awk and several releases of it. There are many awk implementations which each have several versions. All Unices have their own toolset which they maintain in-house and the software that ships with one Unix and that make use of those tools generally rely on those being the exact version of that very implementation.
If you start replacing
/usr/bin/awk with the GNU awk as can be downloaded from http://gnu.org, then you'll run into problems.
Some Unices do package alternate or Free Software versions some of the standard utilities. Generally, they do that by installing them in a different location (
/opt/gnu for instance for GNU tools) or under a different name (
gawk for GNU awk). If not you can download them as source and build them and install them in a different location or under a different name manually yourself.
Having said that, Solaris is known to have very old and non-standard versions of some utilities in
/usr/bin and keep the modern/standard versions in another place.
That's the case of awk.
/usr/bin/awk on Solaris is based on the original awk from 1981. awk was rewritten circa 1988 and called
nawk. All modern
awk implementations are based on that
On Solaris, if you update your
$PATH to put yourself in a standard/POSIX environment (which generally involves putting
/usr/xpg6/bin at the start of
awk will be the standard one. Alternatively, you can call
nawk instead of
That's the same for
sh, you can use
In a standard sh (that is, not
/bin/sh on Solaris), you can also use
command -p awk
To be sure to call the portable awk instead of the old one.