mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
quote the release strings appropriately
This commit is contained in:
parent
49f11d2f75
commit
1c202cccd1
1 changed files with 6 additions and 3 deletions
|
@ -21,15 +21,18 @@ if which lsb_release >/dev/null; then
|
|||
# If lsb_release is available, use it
|
||||
if lsb_release -s -d | grep -qs "^Ubuntu .*\..*\..*$"; then
|
||||
# Use the -d if an Ubuntu LTS
|
||||
lsb_release -s -d
|
||||
r=$(lsb_release -s -d)
|
||||
printf "\005{=b }%s\005{-} " "$r"
|
||||
else
|
||||
# But for other distros the description
|
||||
# is too long, so build from -i and -r
|
||||
printf "\005{=b }%s %s\005{-} " $(lsb_release -s -i) $(lsb_release -s -r)
|
||||
i=$(lsb_release -s -i)
|
||||
r=$(lsb_release -s -r)
|
||||
printf "\005{=b }%s %s\005{-} " "$i" "$r"
|
||||
fi
|
||||
elif [ -r "/etc/issue" ]; then
|
||||
# Otherwise, grab part of /etc/issue
|
||||
printf "\005{=b ..}%s\005{-} " $(head -n1 /etc/issue | awk '{print $1}')
|
||||
printf "\005{=b }%s\005{-} " $(head -n1 /etc/issue | awk '{print $1}')
|
||||
else
|
||||
echo "Unknown"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue