[arch-general] [PATCH 04/48] Use [[ ]] instead of [ ] for conditional checking when running in bash.

Thomas Bächler thomas at archlinux.org
Wed Jun 30 17:56:31 EDT 2010


Am 30.06.2010 23:47, schrieb Victor Lowther:
> It is worth 10 - 30% speedup whenever you want to compare something.

Where do you get this from? I always used [ ], and I found it
sufficient. Why is [[ ]] faster?

> -if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
> +if [[ $USECOLOR = YES || $USECOLOR = yes ]]; then

Why do you get rid of the quoting here? Quoting is nice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20100630/4e491524/attachment.bin>


More information about the arch-general mailing list