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

Nikos Alexandris nik at nikosalexandris.net
Tue Nov 12 07:14:59 PST 2013


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.

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

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


More information about the grass-dev mailing list