[GRASS-dev] Bash aliases in GRASS
Hamish
hamish_b at yahoo.com
Thu Feb 7 18:03:15 PST 2013
> Vaclav Petras wrote:
> > what is the reason for not-loading bash aliases and the
> > user bashrc file when starting new bash? It is meant to
> > prevent conflicts?
Glynn wrote:
> AFAICT, the reason for messing about with the shell startup
> was to force the use of per-mapset history files.
>
> The code which creates the GRASS-specific .bashrc file tries
> to load the aliases, but it does so before HOME has been
> restored, so it doesn't work.
fwiw, for years I have added this to my ~/.grass.bashrc file,
and it has worked fine for the aliases:
. /home/hamish/.bash_aliases
export PS1='GRASS:\W > '
export HISTSIZE=3000
export GRASS_TRUECOLOR=TRUE
export GRASS_PNG_COMPRESSION=9
export GRASS_PAGER=more
# first GRASS instance gets set a low priority
NUMGRASSES=`pgrep -c Init.sh`
if [ "$NUMGRASSES" -le 1 ] ; then
renice +14 -p $$
else
NICENESS=`echo $NUMGRASSES | awk '{printf("%0.f", 20 / $1)}'`
renice +$NICENESS -p $$
fi
The only caveats are that GRASS_ADDON_PATH and (I think)
GRASS_HTML_BROWSER have to be set from your main ~/.bashrc file.
> If you normally use GRASS from the command line, you're
> probably better off just forgetting about the whole "startup"
> thing and putting the necessary environment settings into your
> ~/.bashrc.
me, I start from the command line, but like the extra cleanup
& whatnot the startup script provides. shrug.
Hamish
More information about the grass-dev
mailing list