[GRASS-user] loss of bash aliases
Hamish
hamish_b at yahoo.com
Thu Mar 6 01:49:30 EST 2008
Dylan:
> > I have the following line in my .bashrc:
> >
> > alias l='ls -lh --color=auto'
> >
> > After I start a GRASS session this alias seems to go away. Is
> > there anyway to respect user customization (i.e. .bashrc)
> > when initializing GRASS?
> > Or is this a user-related error?
GRASS's Init.sh does special tricks with $HOME and $bashrc so you can
save your command history, etc., for each mapset.
Then it tries to do:
echo "test -r ~/.alias && . ~/.alias" >> "$bashrc"
but at that point "$HOME" is already redefined so the real
/home/you/.alias is not the one it looks for there?
Fix with "s/~/$USERHOME/" ??
(that bit of the code is a mess, I don't like to touch it)
(history file better handled with $HISTFILE ? see g.mapset warning)
Eric:
> What happens if you copy your alias into ~/.grass.bashrc?
yes that works.
FWIW, my .grass.bashrc has:
.. /home/hamish/.alias
export HISTSIZE=3000
# first GRASS instance gets set a low priority (because we can)
NUMGRASSES=`pgrep -c Init.sh`
if [ "$NUMGRASSES" -le 1 ] ; then
renice +17 -p $$
else
NICENESS=`echo $NUMGRASSES | awk '{printf("%0.f", 20 / $1)}'`
renice +$NICENESS -p $$
fi
Hamish
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the grass-user
mailing list