Reputation: 937
Is it possible to name my gnuplot out file with the date and time it was created? I currently create files with set names as follows:
set term post eps color
set output '/path/dateandtime.eps'
plot
set term x11
Upvotes: 4
Views: 1208
Reputation: 48390
You can use the builtin function time
to get the current timestamp and strftime
to format it:
set output strftime('/path/%F_%H-%M-%S.eps', time(0))
Upvotes: 5
Reputation: 15910
You can get the output from an external command as a string with the system
command:
#!/usr/bin/env gnuplot
date = system("date +%F.%H.%M.%S")
set term ...
set output '/path/'.date.'.eps'
plot
The .
operator concatenates strings.
Upvotes: 3