From: <HBB...@t-...> - 2006-12-08 21:32:30
|
Philipp Fechteler wrote: > Is it possible to pass arguments to a Gnuplot script (in Linux on the > command line), e.g. a file name for a data file. I would like to do the > following kind of script: > > #! /usr/bin/gnuplot > set title ARGV[1] > plot ARGV[1].data using ($16 * 8):20 with linespoints notitle > pause -1 The easiest would be not to make them direct /usr/bin/gnuplot scripts, but rather something like this: #! /bin/sh name=$1 /usr/bin/gnuplot <<\EOF set title "$name" plot "$name.data" using (\$16 * 8):20 with linespoints notitle pause -1 EOF Alternatively, you can put the arguments into environment variables and use `echo $VARIABLE` in your gnuplot script to access them. |