[Buildroot] [PATCH v3 2/3] apply-patches.sh: Use [[...]] construct instead of [...] construct
Thomas De Schampheleire
patrickdepinguin at gmail.com
Thu Jul 31 17:19:34 UTC 2014
Fabio Porcedda <fabio.porcedda at gmail.com> schreef:
>The [[...]] construct it's an improved and safer construct than the
>[...] construct. It's safer because it doesn't do "word splitting" so
>we don't need to enclose variable expansion with double quotes, e.g:
>
> [ -e "$file" ] -> [[ -e $file ]]
>---
I'm not so convinced by this patch. [[]] is a bashism, it is not
supported in all shells.
Yes, using single brackets means that you need to take care,
but anyway shell programming has many pitfalls.
In the past people have sent patches to make Buildroot
more compatible with non-bash shells, so moving in the opposite
direction is not a good idea IMO.
Best regards,
Thomas
More information about the buildroot
mailing list