Replaced regex match with pattern match.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 01 Jun 2021 17:58:43 +0300
changeset 981 79ac660917cb
parent 980 9f36844d6441
child 982 087e216676be
Replaced regex match with pattern match.
.env.bash
--- a/.env.bash	Tue Jun 01 17:48:41 2021 +0300
+++ b/.env.bash	Tue Jun 01 17:58:43 2021 +0300
@@ -22,20 +22,20 @@
 # Easy cd to often used dirs.
 export CDPATH=.:$HOME:$HOME/devel:$HOME/my
 
-if [[ ! :$PATH: =~ :$HOME/usr/xbin: ]]; then
+if [[ :$PATH: != *:$HOME/usr/xbin:* ]]; then
   # To override /bin and /usr/bin.
   export PATH=$HOME/usr/xbin:$PATH
 fi
-if [[ ! :$PATH: =~ :$HOME/usr/bin: ]]; then
+if [[ :$PATH: != *:$HOME/usr/bin:* ]]; then
   export PATH=$PATH:$HOME/usr/bin
 fi
-if [[ ! :$PATH: =~ :/usr/sbin: ]]; then
+if [[ :$PATH: != *:/usr/sbin:* ]]; then
   export PATH=/usr/sbin:$PATH
 fi
-if [[ ! :$PATH: =~ :/sbin: ]]; then
+if [[ :$PATH: != *:/sbin:* ]]; then
   export PATH=/sbin:$PATH
 fi
-if [[ ! :$PATH: =~ :$HOME/.local/bin: ]]; then
+if [[ :$PATH: != *:$HOME/.local/bin:* ]]; then
   export PATH=$PATH:$HOME/.local/bin
 fi
 
@@ -50,16 +50,16 @@
   netbsd*) ;;                               # Do nothing, because NetBSD uses non-GNU man.
   *)
     if [[ -z $MANPATH ]]; then
-        export MANPATH=$HOME/usr/share/man:
-    elif [[ ! $MANPATH =~ $HOME/usr/share/man: ]]; then
-        export MANPATH=$MANPATH:$HOME/usr/share/man:
+      export MANPATH=$HOME/usr/share/man:
+    elif [[ :$MANPATH: != *:$HOME/usr/share/man:* ]]; then
+      export MANPATH=$MANPATH:$HOME/usr/share/man:
     fi
     ;;
 esac
 
 if [[ -z $INFOPATH ]]; then
   export INFOPATH=$HOME/usr/share/info:
-elif [[ ! $INFOPATH =~ $HOME/usr/share/info: ]]; then
+elif [[ :$INFOPATH: != *:$HOME/usr/share/info:* ]]; then
   export INFOPATH=$INFOPATH:$HOME/usr/share/info:
 fi