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

Glynn Clements glynn at gclements.plus.com
Tue Nov 12 07:02:35 PST 2013


Nikos Alexandris wrote:

> Is it wrong to simply:
> 
> for Image in `echo $GIS_OPT_MSX | tr "," "\ "` ; do echo ${Image}  ;  done

That will work, provided that none of the values contain spaces.
But setting IFS is more robust and efficient.

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


More information about the grass-dev mailing list