[LEDE-DEV] [patch master 01/15] Double quote to prevent globbing and word splitting

Lars Kruse lists at sumpfralle.de
Fri Sep 30 16:49:53 PDT 2016


Hi Jan-Tarek,


Am Sat, 1 Oct 2016 01:27:24 +0200
schrieb Jan-Tarek Butt <tarek at ring0.de>:


> > Is there a reason for not adding quotes for CE_VERSION and FILE_NUM?  
> 
> bacause there just nummeric.

personally I would add quotes wherever possible. They would not hurt here.

Whenever I will read the above line in the future, I would think again,
whether the quotes are missing on purpose or just by accident.
This is probably again a question of taste.


> > Just out of curiosity: do you know, what could be the purpose of the "eval"
> > construct above?  
> 
> That command is to check the result of echo $spec
> 
> > I would assume that:
> >  for pattern in $spec; do
> > behaves exactly like:
> >  for pattern in $(eval echo $spec); do  
> 
> are you shure ?

I have to admit, that I never actually used "eval". I think, it is used for
assembling commands out of unpredictable tokens.
My understanding is, that "eval echo $foo" just outputs "$foo".
In the above context the expansion of $(eval echo $spec) should indeed be the
same as $spec.

Anyway: since both of us do not know, whether the original author intended some
esoteric side-effect with this "eval" command, I would suggest to leave this
line unchanged.


Cheers,
Lars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20161001/f1ef47c8/attachment.sig>


More information about the Lede-dev mailing list