[GRASS-dev] GEM Wizard question
Gerald Nelson
gnelson at uiuc.edu
Wed May 23 09:53:28 EDT 2007
As far as I can tell (using the command env) there is no variable that looks like grass home on my system. Jerry
---- Original message ----
>Date: Wed, 23 May 2007 08:45:09 -0500
>From: William Kyngesburye <woklist at kyngchaos.com>
>Subject: Re: [GRASS-dev] GEM Wizard question
>To: Michael Barton <michael.barton at asu.edu>
>Cc: Hamish <hamish_nospam at yahoo.com>, grass-dev at grass.itc.it
>
>Is that from within GRASS, or other shell use? Which platform? If
>GRASS needs HOME as Hamish says, then it won't run without it (or not
>run right), so G_home() will always work. Unless maybe the GRASS
>libraries are used outside of GRASS, like in Qgis or GDAL.
>
>On May 23, 2007, at 1:43 AM, Michael Barton wrote:
>
>> When I've tried to use home without checking for its existence
>> first, I've
>> had reports of errors back from some users who claim that they do
>> not have
>> HOME set to anything. So I always try to check to see if it is valid.
>>
>> Michael
>>
>>
>> On 5/22/07 11:00 PM, "Hamish" <hamish_nospam at yahoo.com> wrote:
>>
>>> William Kyngesburye wrote:
>>>> Note - there is a libgis function to get a user's home: G_home
>>>> (). It
>>>> should work on all platforms (it has a mingw special case, but maybe
>>>> it doesn't work on the Win native build?). It would be handy to
>>>> have
>>>> a command equivalent to use in scripts, like g.home.
>>>
>>> Python/SWIG scripting:
>>>>>> homedir=python_grass6.G_home()
>>>>>> print homedir
>>> /home/hamish
>>>
>>>
>>> "~" is expanded by the shell AFAIK, so that requires a shell to
>>> expand.
>>> "$HOME" works for me, where doesn't it work Michael?*
>>>
>>>
>>> On ms windows there is %HOMEPATH% and %USERPROFILE%.
>>> No idea how they differ,
>>>
>>> MS Windows Command shell overview:
>>>
>>> http://www.microsoft.com/resources/documentation/windows/xp/all/
>>> proddocs/en-us
>>> /ntcmds_shelloverview.mspx?mfr=true
>>>
>>>
>>> [*] GRASS must know where home is, as that's where it looks
>>> for .grassrc6.
>>>
>>> lib/init/init.bat does:
>>> if "%HOME%"=="" set HOME=%USERPROFILE%
>>> set WINGISRC=%HOME%\.grassrc6
>>>
>>> lib/init/init.sh does:
>>> GISRCRC="$HOME/.grassrc6"
>>>
>>>
>>> Hamish
>>>
>>>
>>
>> __________________________________________
>> Michael Barton, Professor of Anthropology
>> School of Human Evolution & Social Change
>> Center for Social Dynamics & Complexity
>> Arizona State University
>>
>> phone: 480-965-6213
>> fax: 480-965-7671
>> www: http://www.public.asu.edu/~cmbarton
>>
>>
>
>-----
>William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
>http://www.kyngchaos.com/
>
>Earth: "Mostly harmless"
>
>- revised entry in the HitchHiker's Guide to the Galaxy
>
>
>_______________________________________________
>grass-dev mailing list
>grass-dev at grass.itc.it
>http://grass.itc.it/mailman/listinfo/grass-dev
Gerald Nelson
Professor, Dept. of Agricultural and Consumer Economics
University of Illinois, Urbana-Champaign
office: 217-333-6465
cell: 217-390-7888
315 Mumford Hall
1301 W. Gregory
Urbana, IL 61801
More information about the grass-dev
mailing list