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 and shell scripting languages 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 01:00 PM
help --translation beijingzhzj UNIX for Dummies Questions & Answers 1 11-10-2006 07:26 PM
perl translation - date command junkmail426 Shell Programming and Scripting 1 09-23-2005 08:30 PM
I need translation! 801238429 Shell Programming and Scripting 7 04-05-2005 01:50 PM
Swedish Character translation rebelwassie High Level Programming 0 10-27-2004 12:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-14-2003
wmosley2 wmosley2 is offline
Registered User
  
 

Join Date: Dec 2003
Location: Atlanta Ga.
Posts: 29
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
#
  #2 (permalink)  
Old 12-15-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0