Svante Signell <[EMAIL PROTECTED]> wrote:
> How to echo the current date and time to a log file?
>
> echo 'date:' ??? 'time:' ??? > file.log
There is no need to use echo.
date +"date: %x time: %X" > file.log
--
Thomas Weinbrenner
On 26/11/2000 at 20:16 +0100, Svante Signell wrote:
> How to echo the current date and time to a log file?
>
> echo 'date:' ??? 'time:' ??? > file.log
>
$ echo date: $(date +%x) time: $(date +%X)
date: 26-11-2000 time: 20:02:07
Is this what you want? Check the date manpage for more options.
On Sun, Nov 26, 2000 at 20:16:50 +0100, Svante Signell wrote:
> How to echo the current date and time to a log file?
>
> echo 'date:' ??? 'time:' ??? > file.log
echo 'date, time:' `date` > file.log
^^ ^^
regular quotes backquotes
HTH,
Ray
--
ART A friend of mi
How to echo the current date and time to a log file?
echo 'date:' ??? 'time:' ??? > file.log
4 matches
Mail list logo