Having lots of problems with certain shopts
authorAndrew DeFaria <Andrew.DeFaria@Broadcom.com>
Mon, 31 Oct 2016 17:55:50 +0000 (10:55 -0700)
committerAndrew DeFaria <Andrew.DeFaria@Broadcom.com>
Mon, 31 Oct 2016 17:55:50 +0000 (10:55 -0700)
Depending on architecture and other things sometimes even the same
version of bash may or may not support things like shopt -s autocd.
My kludgy workaround here is simply to ignore stderr.

rc/bash_login

index d163c7b..4d75a42 100644 (file)
@@ -154,8 +154,8 @@ set +u
 # Shell options
 if [ $ARCHITECTURE != 'Darwin' ]; then
   if ! grep -qP '5\.(6|7|8|9|10)' /etc/*release; then
-    shopt -s autocd
-    shopt -s dirspell
+    shopt -s autocd   > /dev/null 2>&1
+    shopt -s dirspell > /dev/null 2>&1
   fi
 fi