|
From: Dave D. <dde...@es...> - 2006-08-31 19:50:28
|
Dhiman Barman <dh...@ca...> writes:
> hi,
> mean, it will be useful to have support for loops, variable
> assignment in gnuplot files.
>
> if I have to plot 100 files where only the output filename
> and input file name change, it will be useful to have loop
> support...but that also means having compiler/interpreter
> support.
>
>> On Wednesday 30 August 2006 05:19 pm, Dhiman Barman wrote:
>> > Is there any option of taking input from command
>> > line options while running gnuplot file.gnu?
>>
There is a trick I once came up with, but for which I've never really
found a good use for. Maybe this is it...
Assuming unix :
$ gnuplot 3< /tmp/somefile
runs gnuplot with file 3 reading from /tmp/somefile
Then inside your script, you can shell-out to read lines from that file
descriptor.
$ cat /tmp/somefile
hello
world
$ gnuplot 3< /tmp/somefile
G N U P L O T
Version 4.0 patchlevel 0
last modified Thu Apr 15 14:44:22 CEST 2004
System: Linux 2.6.8-2-686-smp
...
gnuplot> print "`head -1 <&3`"
hello
gnuplot> print "`read x <&3 ; echo X $x Y`"
X world Y
You just need to be careful that a shell-ed out process doesn't read
more from the file than you wanted it to.
dd
--
Dave Denholm <dde...@es...> http://www.esmertec.com
|