[GRASS-dev] Re: [GRASS-user] g.list pager

Glynn Clements glynn at gclements.plus.com
Wed Jul 25 15:55:15 EDT 2007


Hamish wrote:

> > > Use .grass.bashrc for setting shell enviro variables instead. (or
> > > .bashrc)
> > 
> > Note that ~/.grass.bashrc only affects the interactive shell which is
> > spawned from Init.sh; it doesn't affect the operation of Init.sh
> > itself. For that, use ~/.bashrc (or similar).
> > 
> > It might be worth having a separate rc file which is sourced from the
> > top of Init.sh.
> 
> is there a point to having two rc files? ie when would you want to use
> the second one if you have the first? better to just source
> .grass.bashrc at the start of Init.sh and dispense with the idea of a
> second script?

You might want to run commands which only make sense for an
interactive shell. rc files aren't limited to environment variables.

> > Also, on the subject of potential Init.sh changes, I'd suggest getting
> > rid of the $HOME "games" and just setting HISTFILE to put the history
> > file in the mapset directory (AFAICT, that is the primary purpose of
> > the $HOME stuff).
> 
> I agree. You say "primary purpose", what else does it touch?

bash reads various files under $HOME at startup. All of these will be
read from the mapset directory, as that is the value of $HOME when the
interactive shell is spawned.

The changes to $HOME are also used to force bash to read the generated
.bashrc file instead of the user's ~/.bashrc, although you can use
--rcfile for that.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list