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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux