Dear all, today I'm scratching my head with a simple (I believe) issue.
Working with date is quite simple, so if I Need to add some seconds to current time, I'll use:
date --date='+30 seconds' +"%Y-%m-%d %H:%M:%S"
But, how to pass the value to add from a variable? I tried the following without success:
[root@RedHat5 ]# echo $COUNTER
100
[root@RedHat5 ]# date --date='+$COUNTER seconds' +"%Y-%m-%d %H:%M:%S"
date: invalid date `+$COUNTER seconds'
Any help?
---------- Post updated at 12:01 PM ---------- Previous update was at 11:56 AM ----------
OMG! It was so simple! :wall:
Sorry if I waste forum space!! :o
date --date='+'$COUNTER' seconds' +"%Y-%m-%d %H:%M:%S"