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

Nikos Alexandris nik at nikosalexandris.net
Wed Nov 13 16:47:34 PST 2013


Nikos wrote:

> >> for Image in `echo $GIS_OPT_MSX | tr "," "\ "` ; do echo ${Image}  ; 
> >> done

Hamish wrote:
 
> Curly brackets do nothing to protect the contents of a variable. Using them
> tricks new bash coders into thinking they are protected when they are not.
> To avoid propagating the damaging myth, only use them when you actually need
> them (eg to protect the variable name from following characters, not its
> contents).

Maybe this should be added in /grass_addons/SUBMITTING_SCRIPTS ?

Nikos

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


More information about the grass-dev mailing list