Command-line use of GRASS

---------- Begin Forwarded Message ----------
Message 5:

From rajguruc@vttcf.cc.vt.edu Fri Jan 31 12:17:13 1992

Received: from vttcf.cc.vt.edu by mtqgrass.ESD.ORNL.GOV (4.1/4.9)
  id AA12020; Fri, 31 Jan 92 12:17:12 EST
Message-Id: <9201311717.AA12020@mtqgrass.ESD.ORNL.GOV>
Received: from vttcf.cc.vt.edu by vttcf.cc.vt.edu id <130194-0@vttcf.cc.vt.edu>; Fri, 31 Jan 1992 12:16:41 +0000
Reply-To: grassp-list@amber.cecer.army.mil
Precedence: Bulk
To: hnw@mtqgrass.esd.ornl.gov
Subject: Command-line use of GRASS
Cc: rajguruc
Date: Fri, 31 Jan 1992 12:16:41 +0000
From: Chaitanya S. Rajguru <rajguruc@vttcf.cc.vt.edu>
Sender: rajguruc@vttcf.cc.vt.edu
Status: R

Hi!

I saw your reply to Lars on the net. About your question about other
programmers using GRASS from the command line, we do not yet use
it that way, but will be doing that soon. We would like to run some
of the GRASS programs along with others that we wrote. But is this
GRASS4.0 that you are runnning from the command line, or the
previous version?

If you are running GRASS4.0 this way, I'd be interested in seeing
how you do it. Is it possible for you to send me a sample program?

Thanks.

-Raj Mobile and Portable Radio Research Group
        Dept. of Electrical Engineering
        Virginia Tech
        Blacksburg, VA 24060-0111
        rajguruc@vttcf.cc.vt.edu
----------- End Forwarded Message -----------

Raj:

     Yes, we are using GRASS 4.0 from the UNIX command line, and it is very
simple to do so. All that is required is to set up the proper environment
variables that GRASS expects to find. Just include these lines in your
.cshrc file:

setenv GISBASE /whereverpath
setenv GISDBASE /whereverpathdata
setenv LOCATION /whereverpathdatamapset
setenv LOCATION_NAME whateverlocation
setenv MAPSET whatevermapset
setenv GISRC /whateverpath/.grassrc

     You could probably set up the required environment just as easily in your
.login or .profile, but I know that this works.

     Of course, you also must add $GISBASE/bin $GISBASE/scripts
and $GISBASE/garden/bin to your path so that GRASS commands will be found.

     That's all there is to it. Using grass in this way gives us more
flexibility, since we can take the best parts of grass and seamlessly
combine them with the best parts of UNIX. That GRASS can be so easily
used in this way is testimony to how well it is written.

     I wonder how the folks at CERL feel about this "abuse" of their fine
product? Can we get into trouble doing this (like with concurrent usage -
<we never have>)?

     One thing you do have to remember is that, if you have occasion to go into
the shell, and you change your mapset there, remember that your mapset is
STILL what it was BEFORE the change AFTER you again exit the shell. This is
only a minor inconvenience. Mapsets and locations can be changed by changing
the above environment variables.

     Hope this info is useful ...
                                 Bill Hargrove
                                 Oak Ridge National Lab
                                 Environmental Sciences Division
                                 Oak Ridge, TN 37831-6038
                                 hnw@mtqgrass.esd.ornl.gov