I want a script that would plot something in GNUPlot.
I did the following.
But after I ran using "sh test.sh", only the gnuplot command-line appeared.Code:gnuplot plot 2*x
Nothing has been plot.
Any help please?
I want a script that would plot something in GNUPlot.
I did the following.
But after I ran using "sh test.sh", only the gnuplot command-line appeared.Code:gnuplot plot 2*x
Nothing has been plot.
Any help please?
Gnuplot itself is not the shell -- altho I've never used it, I'm pretty sure that is the issue here. A parallel might be bc:
The only shell command issued here is "bc" -- all the rest of it are bc commands, not shell command line commands.[root~] bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
2*4
8
(interrupt) use quit to exit.
quit
So if "plot 2*x" is a command you issue to gnuplot after you start it (ie, gnuplot is an interactive command line application), a shell script won't work. One thing you can try which works with bc and might work with gnuplot is:
Actually, some of that is unnecessary but there's the idea.[root~] echo -e "2*4\nquit\n" | bc
8
However, I would guess that gnuplot (like bc and many other interactive CLI programs) will accept instructions from a text file (not a shell script, nb). You should be able to create a file listing gnuplot commands named "do.txt" or something and then start it:
gnuplot do.txt
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge