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

Victor Lowther victor.lowther at gmail.com
Wed Jun 30 17:47:42 EDT 2010


It is worth 10 - 30% speedup whenever you want to compare something.
---
 functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/functions b/functions
index 6df8c5e..9b348b7 100644
--- a/functions
+++ b/functions
@@ -40,7 +40,7 @@ unset TERM_COLORS
 unset TZ
 
 # colors:
-if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
+if [[ $USECOLOR = YES || $USECOLOR = yes ]]; then
 	C_MAIN="\033[1;37;40m"      # main text
 
 	C_OTHER="\033[1;34;40m"     # prefix & brackets
-- 
1.7.1



More information about the arch-general mailing list