I have a script that outputs with timestamps but I can’t manage to have the date evaluate when the specific line is reached; all of the stamps have the time of the script’s first call, that is, they’re all the same, even though the script takes hours to complete.
I’m trying this:
TIMESTAMP=`date +"%H:%M:%S --"`
...
eval "echo $TIMESTAMP Starting backup"
...
eval "echo $TIMESTAMP Doing something here"
What am I doing wrong?
Aliases are handy, easy expansion in an echo line. E.g.:
Yielding: