need translation?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need translation?
# 1  
Old 12-14-2003
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  
Old 12-15-2003
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. IP Networking

Network address translation

How would one approach the problem of determining the NAT tables of a router without knowing the userid and password. The only password holder died. I know the internal ip address of the router is 192.168.2.1, and also ports 80 or 8080 and 3389 are open. (5 Replies)
Discussion started by: jgt
5 Replies

2. AIX

Can't ping - IP translation issue?

Hello, Any help or advice on this would be greatly appreciated. I have a site-to-site VPN, across which data is synced between two CRM systems. The opposing side of this tunnel is a flat network (lets call it 201.200.156.xx/24) My internal network is a 192.168.0.xx/24 network, however before... (2 Replies)
Discussion started by: thruster9
2 Replies

3. UNIX Desktop Questions & Answers

Text Translation

hi all, Im a unix newbie and Im trying to find and replace text and I been looking at these posts since 7 am and I still dont see what Im after. Here is the task at hand. Im trying to translate few lines by doing cat <file> and here is what Im doing <file> 20110228 Mike Original apartment... (4 Replies)
Discussion started by: PG3
4 Replies

4. UNIX for Dummies Questions & Answers

AIX to HP-UX translation please

I have been looking up the allocated space, free space and the contents (raw, jfs, paging) of the logical volumes in AIX servers. I have been using lsvg and lsvg -l (server name). What is the HP-UX equivalent to that? I was given this command also so I would not have to type in each volume group... (2 Replies)
Discussion started by: compan023
2 Replies

5. UNIX for Dummies Questions & Answers

help --translation

I am reading the SANS security policy--.I want to translate the to Chinese.But I don`t understand a paragraph of the. It is :"Where SNMP is used, the community strings must be defined as something other than the standard defaults of "public," "private" and "system" and must be different from... (1 Reply)
Discussion started by: beijingzhzj
1 Replies

6. Shell Programming and Scripting

I need translation!

Someone give me info on this script. I put all the parts I do not understand in BOLD. Please someone explain what the parts in BOLD does/mean. Thanks! #!/bin/bash #Usage: cmdArgs.sh arg1 arg2 arg3 printf "The number of command line args is: $#\n" declare -i counter #Not strictly... (7 Replies)
Discussion started by: 801238429
7 Replies

7. Programming

Swedish Character translation

Sorry if this been posted before. At the moment I'm having problem with the iscntrl() function. I need it to run a check on code entered into a Text Box, however I also need to allow the "Ö, ö" Swedish characters. The iscntrl() function seems to pick up the characters above as part of the... (0 Replies)
Discussion started by: rebelwassie
0 Replies
Login or Register to Ask a Question