[GRASS-dev] Using a multi-"${GIS_OPT_X}" input in a shell for loop

Vaclav Petras wenzeslaus at gmail.com
Tue Nov 12 12:30:01 PST 2013


On Tue, Nov 12, 2013 at 10:14 AM, Nikos Alexandris
<nik at nikosalexandris.net>wrote:

>  Nikos Alexandris wrote:
>
>
>
> > > Is it wrong to simply:
>
> > > for Image in `echo $GIS_OPT_MSX | tr "," "\ "` ; do echo ${Image} ;
> done
>
>
>
> Glynn Clements wrote:
>
>
>
> > That will work, provided that none of the values contain spaces.
>
> > But setting IFS is more robust and efficient.
>
>
>
Is GIS_OPT_MSX also in GRASS 7 (trunk)?


>  Then I'll keep the IFS trick. Note (to myself): don't forget to *reset*
> to default... otherwise:
>
>
>
>
> http://unix.stackexchange.com/questions/98820/why-does-a-working-standalone-nested-function-script-not-work-inside-a-larger-sc
>
>
>
> Thanks a million, Nikos
>
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20131112/4edbc9ae/attachment.html>


More information about the grass-dev mailing list