[GRASS-dev] Custom GRASS command line prompt

Michel Wortmann wortmann at pik-potsdam.de
Mon Dec 15 02:33:20 PST 2014


Hi Nikos, Hamish and list,
you guys played around with your commandline prompts last year (see below), I was just implementing the same thing into my ~/.grass.bashrc (GRASS 7.0.0b3) but found that the location and mapset arent actually changed when changing them with g.mapset, i.e. .grass.bashrc isnt actually executed again.
Whats the best way getting that to work with or without changing source or $GISBASE files?

Best, Michel



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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20141215/fb278a92/attachment.html>


More information about the grass-dev mailing list