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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help getting system date using AWK pgm.

Status
Not open for further replies.

macmc

Programmer
Sep 24, 2007
1
0
0
US
Q: How do you get the system date using AWK ?
I tried the "date" | getline and it shows the date on the screen but waits for a response from pc user to change it.

I just want to print the system date on the screen and end the awk pgm.

Thanks,
macmc
 
Code:
"date" | getline dateNOW; close("date")
printf("This is my current date->[%s]\n", dateNOW)

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
I got the impression the o.p. was running under
windoze, where the user has to press <Enter>
after running "date". Maybe he can clarify this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top