[GRASSLIST:474] where is $LOCATION set

I am really out-of-date with GRASS. I finally installed GRASS 5.0.2 on a
PC running Mandrake Linux and I am having trouble with the environment
variables. When I get into the first screen in GRASS I enter :
Location: hayden
Mapset: erin
Database: /files/data

but if I type cd $LOCATION it puts me in /home/erin. I tried putting a
symbolic link there, but that didn't help. Obviously I have something set
wrong and I can't find where $LOCATION is set to see if I can change it.
(I installed as root, and then remembered that I was supposed to do it as a
regular user. I then tried the latter and it didn't work, so I went back
to being superuser and reinstalled. I guess it could be a problem with
permissions.)
Thanks for any advice.

Erin O'Doherty
eodoherty@fs.fed.us

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Erin ODoherty wrote:

I am really out-of-date with GRASS. I finally installed GRASS 5.0.2 on a
PC running Mandrake Linux and I am having trouble with the environment
variables.

Why "finally"? Mandrake 9.0 and 9.1 ship with grass-5.0.0 in contribs,
and there are RPMs for 5.0.2 for 9.1:

http://ranger.dnsalias.com/mandrake/9.1/grass-5.0.2-1.1mdk.i586.rpm

You can then start grass from the menu
(Applications->Sciences->Geosciences->Grass).

  When I get into the first screen in GRASS I enter :

Location: hayden
Mapset: erin
Database: /files/data

but if I type cd $LOCATION it puts me in /home/erin.

First use echo to see the value of the variable, or env to see all
variables. I think the variable you are looking for is LOCATION_NAME.
Since $LOCATION is emtpy, you are effectively typing "cd ", which will
put you in your home directory.

I tried putting a
symbolic link there, but that didn't help. Obviously I have something set
wrong and I can't find where $LOCATION is set to see if I can change it.
(I installed as root, and then remembered that I was supposed to do it

as a

regular user. I then tried the latter and it didn't work, so I went back
to being superuser and reinstalled. I guess it could be a problem with
permissions.)
Thanks for any advice.

You should normally install software as super-user if you want it to be
accessible system-wide (and not just for one user).

Regards,
Buchan

- --
|--------------Another happy Mandrake Club member--------------|
Buchan Milne Mechanical Engineer, Network Manager
Cellphone * Work +27 82 472 2231 * +27 21 8828820x202
Stellenbosch Automotive Engineering http://www.cae.co.za
GPG Key http://ranger.dnsalias.com/bgmilne.asc
1024D/60D204A7 2919 E232 5610 A038 87B1 72D6 AC92 BA50 60D2 04A7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+906WrJK6UGDSBKcRAguQAJ4oRVvxmU9Ql2usuhc4cAZTsEkLlACfTfxU
q/Cg0zt3uPsHVhBUdPGmUV4=
=IThG
-----END PGP SIGNATURE-----

******************************************************************
Please click on http://www.cae.co.za/disclaimer.htm to read our
e-mail disclaimer or send an e-mail to info@cae.co.za for a copy.
******************************************************************

I don't think it is set anymore. When I launch, cd $LOCATION gives Undefined variable. g.gisenv shows reasonable settings for all of the variables, but none of them seem to end up in the environment as they did in Grass3/4. Tricks like
"alias cdmap 'cd $GISDBASE/$LOCATION_NAME/$MAPSET'" don't work for me now, but I haven't taken the time to track down why.
--
----
Hal Mueller hal@mobilegeographics.com
Mobile Geographics LLC http://www.mobilegeographics.com/
Seattle, Washington (206) 297-9575
Get MapTap for PalmOS: http://www.mobilegeographics.com/maptap/

Erin ODoherty wrote:

I am really out-of-date with GRASS. I finally installed GRASS 5.0.2 on a
PC running Mandrake Linux and I am having trouble with the environment
variables. When I get into the first screen in GRASS I enter :
Location: hayden
Mapset: erin
Database: /files/data

but if I type cd $LOCATION it puts me in /home/erin. I tried putting a
symbolic link there, but that didn't help. Obviously I have something set
wrong and I can't find where $LOCATION is set to see if I can change it.
(I installed as root, and then remembered that I was supposed to do it as a
regular user. I then tried the latter and it didn't work, so I went back
to being superuser and reinstalled. I guess it could be a problem with
permissions.)

GRASS no longer reflects the $GISRC settings (database, location,
mapset) into the shell's environment. Consequently, "cd $LOCATION" is
effectively just "cd" (i.e. change to your home directory).

If you want these settings, you have to use g.gisenv, e.g.

  GISDBASE=`g.gisenv GISDBASE`
  LOCATION_NAME=`g.gisenv LOCATION_NAME`
  MAPSET=`g.gisenv MAPSET`
  LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET

If you find this useful, you can put it into the appropriate startup
file (e.g. ~/.grass.bashrc for bash).

The motivation for the change was to discover any scripts which were
erroneously obtaining this information from the environment instead of
from $GISRC.

At some point, it may be possible[1] to change these settings in the
middle of a GRASS session; in that situation, any environment
variables which were set at startup would no longer be correct.

[1] Actually, it's mostly possible now, but it's not officially
supported, and there are still some rough edges (e.g. "persistent"
programs such as tcltkgrass and NVIZ won't recognise the changes,
XDRIVER can get confused etc).

--
Glynn Clements <glynn.clements@virgin.net>

On Mon, Jun 23, 2003 at 01:50:19PM -0700, Hal Mueller wrote:

I don't think it is set anymore. When I launch, cd $LOCATION gives
Undefined variable. g.gisenv shows reasonable settings for all of
the variables, but none of them seem to end up in the environment as
they did in Grass3/4.

http://freegis.org/cgi-bin/viewcvs.cgi/~checkout~/grass/NEWS.html
-> What's new in GRASS 5.0.0pre4
   "Source Code:

    * etc/Init.sh: $LOCATION does not exist any more, instead it is
      constructed in every script with g.gisenv locally now (enables location
      switching)
   "

Tricks like
"alias cdmap 'cd $GISDBASE/$LOCATION_NAME/$MAPSET'" don't work for
me now, but I haven't taken the time to track down why.

Write it as:
alias cdmap 'cd `g.gisenv GISDBASE`/`g.gisenv LOCATION_NAME`/`g.gisenv MAPSET`'

in BASH:
alias 'cdmap=cd `g.gisenv GISDBASE`/`g.gisenv LOCATION_NAME`/`g.gisenv MAPSET`'

Cheers

Markus
--
Markus Neteler <neteler@itc.it> http://mpa.itc.it
ITC-irst, Istituto per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy