Command-line use of GRASS
hnw at mtqgrass.ESD.ORNL.GOV
Fri Jan 31 13:02:13 EST 1992
---------- Begin Forwarded Message ----------
>From rajguruc at 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 at mtqgrass.ESD.ORNL.GOV>
Received: from vttcf.cc.vt.edu by vttcf.cc.vt.edu id <130194-0 at vttcf.cc.vt.edu>; Fri, 31 Jan 1992 12:16:41 +0000
Reply-To: grassp-list at amber.cecer.army.mil
To: hnw at mtqgrass.esd.ornl.gov
Subject: Command-line use of GRASS
Date: Fri, 31 Jan 1992 12:16:41 +0000
From: Chaitanya S. Rajguru <rajguruc at vttcf.cc.vt.edu>
Sender: rajguruc at vttcf.cc.vt.edu
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
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?
-Raj Mobile and Portable Radio Research Group
Dept. of Electrical Engineering
Blacksburg, VA 24060-0111
rajguruc at vttcf.cc.vt.edu
----------- End Forwarded Message -----------
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
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 ...
Oak Ridge National Lab
Environmental Sciences Division
Oak Ridge, TN 37831-6038
hnw at mtqgrass.esd.ornl.gov
More information about the grass-dev