Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

get current filename?

154 views
Skip to first unread message

Bart Vandewoestyne

unread,
Nov 27, 2008, 8:40:51 AM11/27/08
to
Is there a way to retrieve the name of the currently executed
gnuplot script inside the gnuplot script itself? For example, if
the name of the gnuplot script is myfile.pl, then inside
myfile.pl i would like to have something like

set out "myfile.eps"

where the string 'myfile' is set automatically.

Thanks,
Bart

--
"Share what you know. Learn what you don't."

Lewin Boehnke

unread,
Nov 27, 2008, 1:52:02 PM11/27/08
to
I do not know a way for this using gnuplot but you can write your script using Gnuplot.py (google for it). Then you have full access to python syntax and the scripts name can be found in sys.argv[0].

goo...@catking.net

unread,
Nov 27, 2008, 2:55:08 PM11/27/08
to

Is there some reason why your script cannot contain its own name ?

# top line of script test.pl

basename='test';
set outfile=basename.'.eps';
set datafile=basename.'data';

etc.

or else

bash$ gnuplot << set scriptname='test.pl' ; load 'test.pl'

( PS check syntax ;) )

0 new messages