From 0b337982546aede80e6c5f254ed2f03997d4330b Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 15 Mar 2025 21:24:05 +0100 Subject: Fix: Only acquire OSMAJVER from os-release if present --- .bash/prompt.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" -- cgit v1.2.3