"awk: Function systime is not defined."
but systime is a built in command
"awk: Function systime is not defined."
but systime is a built in command
Seems to be a matter of awk "flavor".
GAWK (gnu awk) includes systime(), but maybe the version you are using does not...
Unless systime calls are meant to keep track of time differences within the awk script itself, a trick to circumvent the lack of awk systime() function would be to pass the value of this system variable as a variable on the awk command line.
As an example, on my system both gawk
and mawk
are installed.
echo |mawk '{print systime()}'
produces:
mawk: line 2: function systime never defined
while
echo |gawk '{print systime()}'
produces:
1252953754
On Solaris, /usr/bin/awk
is by default a link to /usr/bin/oawk
, which does not recognize systime
as a built in (or a lot of other extensions over the 7th Edition AWK). Either relink /usr/bin/awk
to /usr/bin/nawk
or use nawk
directly, or get GNU Awk (gawk
) installed and use that.
Other Unix systems like HP-UX, AIX may have similar issues. MacOS X (and, by inference, BSD) install a non-GNU, non-extended version of awk
(thanks for the correction, DMcKee). Linux does not; it uses GNU Awk as the main/only awk
. Of course, GNU Awk can easily be installed on any of these systems.