How to Use this Document



next up previous contents index
Next: Logging In Up: Unix Survival Guide Previous: Unix Survival Guide

Creating Scratch Files

 


To create a scratch file copy the following command onto your Unix screen and press ctrl-d (^ d).

cat >> area.f 
       PROGRAM area   	   
c area of circle, r input from terminal   	   
       DOUBLE PRECISION pi, r, A   	   
c    Best value of pi for IEEE floating point   	   
       pi = 3.14159265358979323846   	   
c 	read r from standard input (terminal)   	   
       Write(*, *) 'specify radius, e.g. 1.0 '   	   
       Read (*, *)  r   	   
       A = pi * r**2   	   
c    write area onto terminal screen   	   
       Write(*, 10) 'radius r =', r, ' A =', A   	  
 10    Format(a20, f10.5, a15, f12.7)   	   
       STOP 'area'   	   
       END   	  

You have created a file consisting of the listing for a program area.f
(it's Fortran but that doesn't matter).  You can now
use this file to try out the Unix tools and editors. It is small, you
can always get it back if it gets ruined, and you can even compile and
run it.  

If you need more than one scratch file you can use the command:

cp area.f area2.f

to create another scratch file (area2.f).       





next up previous contents index
Next: Logging In Up: Unix Survival Guide Previous: Unix Survival Guide