or construct a command string and execute it:
f = "/path/file.dat"
s = 'echo $(awk ''/Total/ {print $4}'' '.f.')'
a = system(s)
print a
atoms.h wrote:
>
> Hey guy,
>
> I'm trying to integrate shell commands to a gnuplot script. Partly it
> works to the point that I can get values from a shell command to a gnuplot
> variable like this:
>
> scaledata1 = `echo $(awk '/Total/ {print $4}' /path/file.dat)`
>
> Now scaledata1 in gnuplot has the value awk was looking for in file.dat.
> That's great! But what I would like to do is define /path/file.dat as a
> variable in gnuplot and use is in that argument like:
>
> source = "/path/file.dat"
> scaledata1 = `echo $(awk '/Total/ {print $4}' source)`
>
> However, this doesn't work. Also I tried @source.
>
> Any ideas are much appreciated!
> Thomas
>
--
View this message in context: http://old.nabble.com/passing-arguments-to-shell-and-back-from-gnuplot-tp31274799p31276524.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|