rduval
asked on
Concatenate test with formatted output of DATE in Bash Script
I want to append a text string and the date together to the end of text file (a log actually).
I can output the date itself with
I can append text to the file with
But when I try something to put them together like:
I can output the date itself with
date +'%Y-%m-%d %H:%M:%S'
, no problemI can append text to the file with
echo "Manual Restart Completed at " >> log/myservice.log
again, no problem.But when I try something to put them together like:
echo "Manual Restart Completed at " DATE +'%Y-%m-%d %H:%M:%S' >> /var/log/myservice.log
it fails and I've googled for an hour and can't find the solution.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER