[GRASS-dev] Re: diff to start wingrass with GUI + com.exe terminal [was: Re: [winGRASS] (no subject)]

Glynn Clements glynn at gclements.plus.com
Mon May 21 22:50:06 EDT 2007


Michael Barton wrote:

> >> AFAICT, you can do this for any bash or python script (or whatever the
> >> shell
> >> can do something with).
> >> 
> > 
> > Yes, if you have a preexisting script. But you cannot type and run
> > something like (nonesense script for demonstration):
> > 
> > for val, col in $valnames
> > do
> >   d.vect map=X fcolor=$col cat=$val
> > done
> > 
> > You would have to save it as a script in your PATH and then launch it as
> > such.
> 
> I know that you can do this with Python. But can you do it with a normal
> bash terminal and shell scripting? I thought you are limited to what you can
> do on one line.

Bourne shells know when they have "incomplete" input (e.g. do/if/case
without a matching done/fi/esac, unmatched quotes, parentheses, etc),
and will keep prompting (using $PS2) for more input until they have a
complete command.

IIRC, C shells are more restrictive, e.g. you can't use loops (etc)
interactively, only in scripts.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list