[GRASSLIST:6010] Re: Problem using r.in.ascii
Glynn Clements
glynn.clements at virgin.net
Thu Apr 10 11:54:44 EDT 2003
Markus Neteler wrote:
> > Never mind this message. After fighting with it all day yesterday, I
> > discovered a mask file that I had forgotten about because I've slept since
> > then. I only figured it out about it when I tried to draw a new mask file
> > for surfacing, and THAT wouldn't display.
> >
> > NUTS!!
>
> What if there were the work 'MASK' or just 'M' in the GRASS prompt?
> I was fighing with the same problem recently ...
>
> Something like
> GRASS:~ >
> and
> GRASS(M):~ >
>
> in case a MASK is present. Maybe there is a possibility to
> add a file check to
> PS1='GRASS:\w > '
> ?
With bash, the variable PROMPT_COMMAND can be used to specify a
command which is run before printing the prompt. E.g.
PROMPT_COMMAND='if r.info MASK &> /dev/null ; then echo -n "GRASS(M):" ; else echo -n "GRASS:" ; fi'
PS1='\w '
Except that the above will repeatedly send you email with the error
message from r.info when MASK doesn't exist. Ideally, you want a
dedicated utility which tests for the existence of a mask.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-user
mailing list