Search code examples
shellgnuplot

Gnuplot from a standard shell without entering gnuplot interactive shell


Is it possible to run a gnuplot from a standard shell without entering the gnuplot interactive shell?

I just want to be able to type my gnuplot commands in one line from my standard shell and to be able to save standard gnuplots as aliases. Currently I have to create .sh files where I write my commands which is quite terrible.


Solution

  • Do you mean

    echo "plot sin(x)" | gnuplot -p
    

    OR

    echo -e "set term png\n set output 'alma.png'\n plot sin(x)\n" | gnuplot
    

    ?

    OR

    echo | gnuplot -p -e "plot sin(x)" 
    

    (last one by Christoph)