in reply to Append the timestamp before and after the data in the logfile
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:
date > test.log ; perl test.pl >> test.log ; date >> test.log
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,
Darren :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Append the timestamp before and after the data in the logfile
by Kanji (Parson) on Dec 22, 2005 at 05:33 UTC | |
by blazar (Canon) on Dec 22, 2005 at 10:18 UTC | |
|
Re^2: Append the timestamp before and after the data in the logfile
by kulls (Hermit) on Dec 22, 2005 at 06:05 UTC | |
by McDarren (Abbot) on Dec 22, 2005 at 06:14 UTC | |
by kulls (Hermit) on Dec 22, 2005 at 06:36 UTC | |
by McDarren (Abbot) on Dec 22, 2005 at 07:02 UTC | |
by blazar (Canon) on Dec 27, 2005 at 13:55 UTC | |
by blazar (Canon) on Dec 27, 2005 at 14:07 UTC |