The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
S-286: PHP Path Translation Vulnerability iBot Security Advisories (RSS) 0 05-09-2008 09:00 AM
help --translation beijingzhzj UNIX for Dummies Questions & Answers 1 11-10-2006 03:26 PM
perl translation - date command junkmail426 Shell Programming and Scripting 1 09-23-2005 04:30 PM
I need translation! 801238429 Shell Programming and Scripting 7 04-05-2005 09:50 AM
Swedish Character translation rebelwassie High Level Programming 0 10-27-2004 08:04 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-14-2003
Registered User
 

Join Date: Dec 2003
Location: Atlanta Ga.
Posts: 29
Stumble this Post!
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
#
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-15-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,443
Stumble this Post!
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0