oawk is "old awk", it is the default /usr/bin/awk on Solaris and should not be used. You can also find it in The Heirloom Toolchest
Here are some reason why it's called "old" taken from this post by Ed Morton, if you have more please reply to the above thread and/or edit this page.
$ echo "foo" | /usr/xpg4/bin/awk '1{print}' foo $ echo "foo" | /usr/bin/awk '1==1{print}' foo $ echo "foo" | /usr/bin/awk '1{print}' awk: syntax error near line 1 awk: bailing out near line 1 $ echo "foo" | /usr/bin/awk '1==1{print}' foo $ echo "foo" | /usr/xpg4/bin/awk '!x{print}' foo $ echo "foo" | /usr/bin/awk '!x{print}' awk: syntax error near line 1 awk: bailing out near line 1 foo $ echo "foo" | /usr/bin/awk 'x!=0{print}' foo
$ echo "foo" | /usr/xpg4/bin/awk '{print ($0=="foo") ? "yes" : "no"}' yes $ echo "foo" | /usr/bin/awk '{print ($0=="foo") ? "yes" : "no"}' awk: syntax error near line 1 awk: illegal statement near line 1
$ echo "foo" | /usr/xpg4/bin/awk '{print "<"ARGC">"}' <1> $ echo "foo" | /usr/bin/awk '{print "<"ARGC">"}' <>
$ echo "foo" | /usr/xpg4/bin/awk '{print "<" sub(/o/,"X") ">"}' <1> $ echo "foo" | /usr/bin/awk '{print "<" sub(/o/,"X") ">"}' awk: syntax error near line 1 awk: illegal statement near line 1
$ echo "foo" | /usr/xpg4/bin/awk -v var="X" '{print "<" $0,var ">"}' <foo X> $ echo "foo" | /usr/bin/awk -v var="X" '{print "<" $0,var ">"}' awk: syntax error near line 1 awk: bailing out near line 1
$ echo "foo" | /usr/xpg4/bin/awk '{print sprintf("%s =",$0), "<bar>"}' foo = <bar> $ echo "foo" | /usr/bin/awk '{print sprintf("%s =",$0), "<bar>"}' foo =
$ echo "foo" | /usr/xpg4/bin/awk 'function bar(){print} {bar()}' foo $ echo "foo" | /usr/bin/awk 'function bar(){print} {bar()}' awk: syntax error near line 1 awk: bailing out near line 1
$ echo "foo" | /usr/xpg4/bin/awk 'BEGIN{re="o"} $0 ~ re {print}' foo $ echo "foo" | /usr/bin/awk 'BEGIN{re="o"} $0 ~ re {print}' awk: syntax error near line 1 awk: bailing out near line 1
$ time /usr/xpg4/bin/awk 'BEGIN{print "begin"}' begin real 0m0.06s user 0m0.01s sys 0m0.02s $ time /usr/bin/awk 'BEGIN{print "begin"}' begin ^?$
$ /usr/xpg4/bin/awk 'BEGIN{ a[1]=a[2]; delete a[1]; for (i in a) print i; exit }' 2 $ /usr/bin/awk 'BEGIN{ a[1]=a[2]; delete a[1]; for (i in a) print i; exit }' 2 1
$ /usr/xpg4/bin/awk 'BEGIN{ a[1]=7; if (1 in a) print a[1]; exit }' 7 $ /usr/bin/awk 'BEGIN{ a[1]=7; if (1 in a) print a[1]; exit }' awk: syntax error near line 1 awk: illegal statement near line 1
$ cat file1 a $ cat file2 b $ /usr/xpg4/bin/awk 'NR==FNR{print}' file1 file2 a $ /usr/bin/awk 'NR==FNR{print}' file1 file2
$ /usr/xpg4/bin/awk '{print match($0,"a")}' file1 file2 1 0 $ /usr/bin/awk '{print match($0,"a")}' file1 file2 awk: syntax error near line 1 awk: illegal statement near line 1
$ echo "faobo" | /usr/xpg4/bin/awk '{ print $1,$2,$3 }' FS="[ab]" f o o $ echo "faobo" | /usr/bin/awk '{ print $1,$2,$3 }' FS="[ab]" faobo
$ /usr/xpg4/bin/awk 'BEGIN{$0="foo"; print}' foo $ /usr/bin/awk 'BEGIN{$0="foo"; print}' awk: can't set $0
$ /usr/xpg4/bin/awk 'BEGIN{ c=3; print "c=" ++c; exit }' c=4 $ /usr/bin/awk 'BEGIN{ c=3; print "c=" ++c; exit }' 03 $ /usr/xpg4/bin/awk 'BEGIN{ c=3; print "c=" ++c; print ++"c=" c; exit }' /usr/xpg4/bin/awk: syntax error Context is: >>> BEGIN{ c=3; print "c=" ++c; print ++"c=" <<< $ /usr/bin/awk 'BEGIN{ c=3; print "c=" ++c; print ++"c=" c; exit }' 03 23