[GRASS-dev] aliases in GRASS

Robert Nuske rnuske at gwdg.de
Thu Feb 22 14:30:33 EST 2007


Thanks Glynn for your answer!

> > If started form a bash, GRASS prepares its own .bashrc in the chosen
> > Location and starts a child shell (= GRASS-Shell) from there, as stated
> > in 'grass-6.3.cvs/etc/Init.sh'. This Shell knows only the setting from
> > the newly created .bashrc, so I guess I need to get my aliases in that
> > file.
>
> If you create a file called ~/.grass.bashrc, its contents will be
> appended to the temporary .bashrc file.

Yes, I've seen this, but felt repelled to keep two lists of aliases.

> If you put ". ~/.bashrc" into 
> that file, it should source your original ~/.bashrc file ($HOME should
> have been restored at that point).

yep, that looks like a solution. I was so fixated on the ~/.alias in Init.sh 
that I wasn't looking that way.


> > In line 815 in 'grass-6.3.cvs/etc/Init.sh'  a .alias-file is executed if
> > it is readable. Since the environment variable HOME is set to LOCATION in
> > line 810 it looks for a .alias file in LOCATION and not in the users home
> > directory, is this intended?
> >
> > If line 815 would read
> >     echo "test -r ${USERHOME}/.alias && . ${USERHOME}/.alias" >>
> > "$bashrc" instead of
> >     echo "test -r ~/.alias && . ~/.alias" >> "$bashrc"
> > the user's alias-settings would be carried over to the GRASS-Shell.
> >
> > It would be even nicer if the GRASS-Startup-Script could parse my
> > .bashrc, but I have no idea how to achieve that.
> >
> > Looking forward to comments about the intention of line 815
> > in 'grass-6.3.cvs/etc/Init.sh' .
>
> Probably someone forgot that $HOME hadn't been reverted at that point.
> Reverting $PATH and $HOME should probably come first. Actually, I'm
> not sure that there's any need to mess with $HOME; AFAICT, it was done
> so that the .bash_history file would get stored in the mapset, but
> that can be achieved by setting HISTFILE.

So, am I right that this line is useless in its current state and should be 
changed or taken out? 
I would prefer if it would source the .alias in the users home directory.
 
cheers,
  robert




More information about the grass-dev mailing list