diff options
author | mail_redacted_for_web | 2025-03-15 21:24:05 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2025-03-15 21:24:05 +0100 |
commit | 0b337982546aede80e6c5f254ed2f03997d4330b (patch) | |
tree | c19eaf745fac43746d5c38d400293c981a032348 | |
parent | 705a4d60f230d06f5298a70851a2d42ae97be97b (diff) | |
download | dotfiles-0b337982546aede80e6c5f254ed2f03997d4330b.tar.bz2 |
Fix: Only acquire OSMAJVER from os-release if presentv1.2.5
-rw-r--r-- | .bash/prompt.bash | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.bash/prompt.bash b/.bash/prompt.bash index c54e8dc..58ecd11 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -17,7 +17,9 @@ bgcolor () { # stupid old asterisk (*). Well, here hetting "no digits" practically won't hurt. MYUID="$(id|sed 's/.*uid=\([0-9]*\).*/\1/g')";export MYUID # ...because "empty" will hit the "any" condition in the end :) -OSMAJVER="$(grep '^VERSION_ID' /etc/os-release|awk -F= '{print $NF}'|sed 's/"//g'|awk -F\. '{print $1}')" +if [ -r '/etc/os-release' ]; then + OSMAJVER="$(grep '^VERSION_ID' /etc/os-release 2>/dev/null|awk -F= '{print $NF}'|sed 's/"//g'|awk -F\. '{print $1}')" +fi case "$MYUID" in 0) FGC1="fgcolor 88" |