Reputation: 505
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")
Upvotes: 3
Views: 199
Reputation: 56189
Couldn't show backticks in the comments, see below:
R CMD BATCH $HOME/test.R $HOME/runoutput/test_`date +"%F_%H_%M_%S"`
Upvotes: 2