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

date and time in a log file

Status
Not open for further replies.

sumncguy

IS-IT--Management
May 22, 2006
118
US
I would like to create a log file using

log_file <somename>.log
.
.
.
.
log_file

Where somename contains the date and time.


The Ksh equivalent :
set `date`
nam=`echo $2""$3""$4 | sed 's/\://g'`

the result would be $nam.log
Jun15165115.log
 
set nam "[ clock format [ clock seconds ] -format "%Y-%m-%d" ].log"

(I suggest revers date for easier sorting)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top