Add timestamp to filename R CMD BATCH

I want to run a script and call outfile. The default looks like this:

R CMD BATCH $HOME/test.R $HOME/runoutput/test_

      

How do I add a timestamp to a name?

Something like that:

R CMD BATCH $HOME/test.R $HOME/runoutput/test_$(date +"%F_%H_%M_%S")

      

+3


source to share


1 answer


Failed to show backlinks in comments, see below:



R CMD BATCH $HOME/test.R $HOME/runoutput/test_`date +"%F_%H_%M_%S"`

      

+2


source







All Articles