Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system date

Status
Not open for further replies.

sabetik

IS-IT--Management
Nov 16, 2003
80
GU
Is there a way to print system date?
 
strftime is a GNU extension.
One more concentional way:
awk 'BEGIN{"date"|getline;print}'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
How can use in printf function:

printf ("date:, strftime(%c), \n") > "test.xls"

getting error message.

thanks again
 
You wanted this ?
awk 'BEGIN{printf("date: %s\n",strftime("%c"))}'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Code:
gawk ' BEGIN {printf("Date: %s\n",strftime("%c"))}'
OR-
awk ' BEGIN {"date +%c" | getline out ;printf("Date: %s\n",out);}'

And really..shouldn't everyone who can be using gawk by
now?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top