gnuplot doesn't work through ssh command
That means, that your self-compiled gnuplot probably isn't found when you log-in with ssh
. Type which gnuplot
in both cases to see which binary is used.
Usually when using ssh
you get a non-interactive shell, which sources different configuration files and has different environmental variables than a login shell, see e.g. Why does an SSH remote command get fewer environment variables then when run manually?.
So you can either change the respective configuration files (which ones are used, depends on your distribution), or you can use the full path to the gnuplot binary.
Gnuplot using shell command to set yrange
Could it be possible that you are using the wrong quotes?
gnuplot> n = `echo 2`
gnuplot> print n
2
Applied to you specific case, and after some refactoring:
pres_max = `awk '/average\(inlet\) of p/{p=$9} END{print p}' log.xy`
pres_min = pres_max - 10
set yrange [pres_min:pres_max]
See section "Substitution and Command line macros" of the gnuplot manual
gnuplot and Shell script read many files and create graphs
One of the arguments passed to the "plot" command has a trailing space following it. It's possible that this is being interpreted as part of the filename. Remove the trailing space and see if the behavior improves.
You use the construct "$PlotInputLoc/$PlotInputName-$i.$PNext
" many times. You may find it less error-prone (and more readable) to store this as a variable instead of copy/pasting the same thing over and over.
Also, your code that increments the i
variable is inside the script that gets passed to gnuplot. The bash variable i
in never being updated, so you'll loop continuously. Try swapping your EOF
and i=$(( $i + 1 ))
lines.
Related Topics
How to Pass a Complete Argument List in Bash While Keeping Mulitword Arguments Together
How to Get the Exit Status of the First Command in a Pipe
Fsync, Sync: Does It Really Do What Its Supposed To
Why Would the Elf Header of a Shared Library Specify Linux as the Osabi
Unable to Set Variable in Case Statement Bash
Making Proprietary Elf Binaries Portable on Linux
How to Execute 32-Bit Code in 64-Bit Process by Doing Mode-Switching
How to to Delete a Line Given with a Variable in Sed
Check If a File Exists with a Filename Containing Spaces
How to Disable Hardware Prefetcher in Core I7
Install Binaries into /Bin, /Sbin, /Usr/Bin and /Usr/Sbin, Interactions with --Prefix and Destdir
Netcat Tcp Programming with Bash
Measuring Stack Usage for Linux Multi-Threaded App
Changing the Owner of an Existing Process in Linux
Is It Safe to Call Dlclose(Null)
How to Get the Output of Ansible Ad-Hoc Command in JSON, CSV or Other Format