gnuplot 5.2 patchlevel 8
I am trying to update the window title and / or plot title in a loop. It appears that in a while... loop some shell commands (date) don't refresh? I am trying to have the current date in a title, and also a part of a file (tail -1 datafile.dat) but neither seem to update in a loop according to the stdout print.
Running on Ubuntu 20.10
More debugging... apparently the backtick evaluation just does not seem to work in a while... loop, before it works fine when done multiple times with replot. In the loop, it evaluates correctly the first time but not on subsequent loops
Correct. Substitution is done once, when the input line is first read. This is true for back-tick substitution and also macro expansion (@VARNAME). You can think of it as acting like the C language preprocessor. Once the substitution is made you can execute the code multiple times, for instance in a while loop, but that will not change the code that is being executed.
If you need dynamic reevaluation, use the system("shell command") call instead.
Thanks, works now. Would be good to put that in the documentation, I didn't find it anywhere.
See http://www.gnuplot.info/docs_5.4/Gnuplot_5_4.pdf p 234 under "while"
Thanks!
Last edit: internationils 2021-04-30
It's under
substitution.