I want to run a script, and name the outfile. The default looks like this:
R CMD BATCH $HOME/test.R $HOME/runoutput/test_
How do I add a timestamp to the name?
Something like this:
R CMD BATCH $HOME/test.R $HOME/runoutput/test_$(date +"%F_%H_%M_%S")
Advertisement
Answer
Couldn’t show backticks in the comments, see below:
R CMD BATCH $HOME/test.R $HOME/runoutput/test_`date +"%F_%H_%M_%S"`