On Thu, Oct 3, 2013 at 8:44 PM, Nikos Alexandris <[email protected]>
wrote:
>
> Yann wrote:
>
> > > The command was :
> > > v.in.ascii -z input=${FILE} output=${NAME_OUT} separator="${FS}" z=3
> > > --overwrite
>
> Hamish wrote:
>
> > Hi,
>
> > just to note -- the {curly} brackets do nothing to
> > protect from spaces in filenames in this situation,
> > "double" quotes should be used for that.
> >
> > the curly brackets protect the variable name, not its
> > contents, so are mostly useful for when a letter,
> > number, or "_" follows the variable name.
> >
> > I actually think it is dangerous to use the curly
> > brackets because it tricks people into thinking they
> > are protected when they are not.
>
> Maybe "${FILE}" then?  I remember this as being Glynn's recommendation,
some
> time ago...
>
Yes "${FILE}" should protect spaces and variable name.

$ MY_VARIABLE="GRASS is GIS"
$ for A in $MY_VARIABLE; do echo $A; done;
GRASS
is
GIS
$ for A in "${MY_VARIABLE}"; do echo $A; done;
GRASS is GIS

But if I want to make thinks robust I use Python. Although module call
itself is more complicated

input=file_name

is less complicated than

input="${FILE}"

Best,
Vaclav

>
> Best, Nikos
>
> _______________________________________________
> grass-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to