Nawk Time Function

Hi All,

I am using solaris and nawk.
Is there any time function in nawk which is simliar to the shell `date` function ?
Can any experts show any examples?

you can execute nawk's built-in system() function to execute `date` command: system(date)

Hi Yogesh Sawant,

I tried to use the below but it's showing a zero after the display of date.
Why is that so ? Can you help me to remove it ?

$ nawk 'BEGIN{print system("date")}' web_awk
Thu Nov  1 15:33:55 SGT 2007
0
nawk 'BEGIN {
	system("date")
}'

without system():

awk 'BEGIN { print | "date"; exit }'

Hi radoulov,

Both codes work!!!
Thanks alot!!