[GRASS-dev] Custom GRASS command line prompt

Nikos Alexandris nik at nikosalexandris.net
Sun Jul 28 13:43:16 PDT 2013


Nikos:

> > Now it appears like:  "G 7.0.svn (utm_37s/post):~ >".  My understanding is
> > that I probably need to edit the file:
> > grass7_trunk/dist.x86_64-unknown-linux-gnu/grass70.tmp


Hamish:

> I'd suggest to put the change in ~/.grass.bashrc instead.


Nikos:

> Hamish,
> 
> don't want to waist your time, but I have put soemthing like
> 
> SHORT_VER=`echo "$GRASS_VERSION" | cut -f1,2 -d. | sed -e 's/\.//'`
> GLOCATION=`echo "${LOCATION_NAME}"`
> GMAPSET=`echo "${MAPSET}"`
> export PS1='G$SHORT_VER ${GLOCATION}/${GMAPSET}:\w > '
> export PROMPT_DIRTRIM=2
> 
> which doesn't work! :-/
> 
> Where should $LOCATION_NAME, $MAPSET be fed from?

I got it...

GLOCATION=`g.gisenv get="LOCATION_NAME"`
GMAPSET=`g.gisenv get="MAPSET"`

Nikos




More information about the grass-dev mailing list