git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/.bash/prompt.bash
diff options
context:
space:
mode:
Diffstat (limited to '.bash/prompt.bash')
-rw-r--r--.bash/prompt.bash4
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"