I think (please be more specific [updated at the end of the answer] if you want more specific help) you have a file (call it file
for the sake of being original) like this:
This is a file with some text in it.
The slope of my curve should be slope = 6.
And some more text here.
And want to use the value slope = 6
as the slope of a function in gnuplot. You need to read in this number, for which you should use some bash utility once you know how to find it. In the very simple case above, you could look for slope =
in your file with grep
and then use =
as a delimiter with cut
and tell awk
to print the first thing it finds:
grep "slope =" file | cut -d "=" -f2 | awk '{print $1}'
Now go to gnuplot and use this as a variable:
slope = `grep "slope =" file | cut -d "=" -f2 | awk '{print $1}'`
plot slope*x
And this is what you get in my example, where slope = 6
:
You'll probably need to adapt this to your problem but unless you include more details it's impossible to give you better guidance.
For the specific case where you want the first record on the second line:
a = `awk 'NR==2 {print $1}' file`
plot a*x