I'm trying to redirect the stdout and stderr to a log file. The filename should be created dynamically with current timestamp.
I can create the filename with the following command:
$ date +%Y-%m-%d_%H-%M-%S.txt 2018-04-10_16-55-55.txt
So I want to do something like this:
mycommand &> (date +%Y-%m-%d_%H-%M-%S.txt)
But this doesn't work (
-bash: syntax error near unexpected token('`)