0

I have a bash script that executes gnuplot:

#!/bin/bash
# some bash scripting here
gnuplot -persist <<EOF
# some gnuplot scripting here
EOF

If the script wa executed I return to the usual terminal input. But what I would like to have is that the gnuplot command prompt stays open such that I can enter gnuplot commands in order to further manipulate the plot.

Is that possible?

1 Answer 1

3

What you could do is put all your gnuplot instructions in a standard text file, instead of a shell script. Then, you can execute this set of instruction in the gnuplot command prompt using:

load 'my_instruction_file.txt'

This way your gnuplot script is executed and you can still add instructions in the prompt.

The bash commands in your original script can be executed from the gnuplot command prompt using the system command :

system "my_bash_instruction"

For instance, you could write all your bash instructions in a script and execute this script from gnuplot.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, but then I can not perform the bash commands before the gnuplot commands in one single script.
Right, I missed that. Gnuplot has a system command that enables calling shell instructions. I edited my answer to include it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.