|
From: Robbie M. <ro...@ac...> - 2011-03-08 10:25:15
|
Hello all It would be rather useful if the current filename was available from within a gnuplot script. This suggestion was raised in 2008 and 2009 respectively: http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/thread/2b34fa67a0365173/8f8c63c891f59aeb?lnk=gst&q=%22current+filename%22#8f8c63c891f59aeb http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/thread/781545ccfbaada56/ebffa12161a37fe3?lnk=gst&q=%22get+filename%22#ebffa12161a37fe3 And, AFAIK, has not been resolved. One approach might be: assume the file 'myfile.gp' contains the lines: myfile = GPVAL_LOAD_FILE print "myfile = ", myfile then entering the command: load "myfile.gp" would display either of the following -- the first being a simple echo and the second being the canonical file path: myfile = myfile.gp myfile = /path/to/myfile.gp On termination, GPVAL_LOAD_FILE would be unset. Another approach (probably too late) would have been to have the 'call' command assign the filename to $0 in line with most other shell positional variable conventions. If there is a work-around, that would be good to know. best wishes Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical University of Berlin (TU-Berlin), Germany University email (redirected) : mor...@ie... Webmail (preferred) : ro...@ac... [from Webmail client] |