# HG changeset patch # User Oleksandr Gavenko # Date 1622559523 -10800 # Node ID 79ac660917cbc7f35fc17bfad4a350d2ffa34a07 # Parent 9f36844d6441764b6b0631c805cf942ef6dcbee5 Replaced regex match with pattern match. diff -r 9f36844d6441 -r 79ac660917cb .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