diff options
author | mail_redacted_for_web | 2025-03-15 21:10:04 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2025-03-15 21:10:04 +0100 |
commit | 672a8bda092a03eb93e068deb2cbdcf355b06c68 (patch) | |
tree | f40830d6433f35648f8fd4a94c3b37de36219c6c /.bash/vars.bash | |
parent | 4c0b4468554f704633350b0e0cdd4ad174da349b (diff) | |
download | dotfiles-672a8bda092a03eb93e068deb2cbdcf355b06c68.tar.bz2 |
Further grep adjustments where -P is not necessary (auto)
Diffstat (limited to '.bash/vars.bash')
-rw-r--r-- | .bash/vars.bash | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/.bash/vars.bash b/.bash/vars.bash index b9b1b19..8b99807 100644 --- a/.bash/vars.bash +++ b/.bash/vars.bash @@ -20,7 +20,7 @@ export SSHAGH # ----- SHELL ----- # for pa in "/usr/local/bin" "${HOME}/bin" "${HOME}/.local/bin" "${HOME}/go/bin";do if [ -x "$pa" ]; then - if ! printf "%b" "$PATH"|grep -P "^${pa}:|:${pa}:" >/dev/null;then + if ! printf "%b" "$PATH"|grep -E "^${pa}:|:${pa}:" >/dev/null;then export PATH="${pa}:${PATH}" fi fi @@ -30,9 +30,9 @@ if [ -r "/etc/os-release" ];then OSNAME="$(grep ^ID /etc/os-release|awk -F= '{print $NF}'|head -n1|sed 's/"//g')" elif [ "$(uname -s)" == 'SunOS' ]; then OSNAME="sunos" elif [ -r "/etc/redhat-release" ];then - grep -P "^Red[\ ]?[Hh]at" /etc/redhat-release >/dev/null 2>&1 && OSNAME="redhat" - grep -P "^[Ff]edora" /etc/redhat-release >/dev/null 2>&1 && OSNAME="fedora" - grep -P "^[Cc]ent[Oo][Ss]" /etc/redhat-release >/dev/null 2>&1 && OSNAME="centos" + grep -E "^Red[\ ]?[Hh]at" /etc/redhat-release >/dev/null 2>&1 && OSNAME="redhat" + grep -E "^[Ff]edora" /etc/redhat-release >/dev/null 2>&1 && OSNAME="fedora" + grep -E "^[Cc]ent[Oo][Ss]" /etc/redhat-release >/dev/null 2>&1 && OSNAME="centos" [ -z "$OSNAME" ]&&OSNAME="obsolete" elif [ -r "/etc/SuSE-release" ];then OSNAME="oldsuse" |