Perl: the Markov chain saw | |
PerlMonks |
Re: Append the timestamp before and after the data in the logfileby McDarren (Abbot) |
on Dec 22, 2005 at 05:12 UTC ( [id://518477]=note: print w/replies, xml ) | Need Help?? |
Is there any commands available in the shell script itself?Yes, there is. It's called the date command. This is not how I would choose to do this, but to answer your question directly, you could simply do:
Note the use of >> rather than >, this ensures that your logfile is appended to rather than overwritten. You should also check man date for the various formatting options. Cheers,
In Section
Seekers of Perl Wisdom
|
|