need translation?

Can someone tell me exactly what this code is doing?

#
# gnutest
#
# Test launch of ghostscript (gs) from a script
#
rm gnutest.ps
#
# ------- calculation that would generate file(s) to
# be plotted with gnuplot would be placed here -----------
#
gnuplot << \E-o-f2
set terminal postscript
set output "gnutest.ps"
set xrange [-0.5:3.5]
set yrange [-9:5]
plot 3.1*x-8.3 with lines
\E-o-f2
#
echo " "
echo " Type quit to exit ghostscript "
echo " "
#
gs gnutest.ps
#

Well it removes a file.

Then it runs a program called gnuplot. That << thing is called a "here document". All of those lines until the "\e-o-f2 are sort of a datafile. When gnuplot decides to read a line, the first line it will read is "set terminal postscript".

Then a little message is displayed via echo.

Finally a program called "gs" is run.

I have not used the programs called gnuplot and gs, so I should stop here. But I'll continue anyway with guesses. I do know unix and analyltic geometry so they are educated guesses.

gnuplot is going to output stuff in postscript format to gnutest.ps. Then it draw the function y=3.1x-8.3. That is a straight line that intercepts the x axis at -8.3 and has a slope 3.1. The part of the y axis that we will set starts at -9 and extends to 5. And the x axis runs from -.5 to to 3.5. That is actually the reverse of what I would want to do. So maybe my guess is a little off or maybe the author of this code reversed his xrange and yrange. And we will get grid lines.

You will be running this on an x terminal and will have your DISPLAY environment variable set. gs will display that output file in a new window on your x terminal.