cd_grep_os

This commit is contained in:
Marc Beninca 2024-06-08 13:24:43 +02:00
parent 58262405bf
commit 5e8dd6fec2
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

8
cd.sh
View file

@ -626,10 +626,10 @@ local variable="${1}"
} }
cd_grep_os () { cd_grep_os () {
local variable="${1}" cd_grep_os__variable="${1}"
if [ "${variable}" ] ; then if [ "${cd_grep_os__variable}" ] ; then
grep "^${variable}=" "/etc/os-release" \ grep "^${cd_grep_os__variable}=" "/etc/os-release" \
| sed "s|^${variable}=||" \ | sed "s|^${cd_grep_os__variable}=||" \
| sed "s|^\"\(.*\)\"$|\1|" | sed "s|^\"\(.*\)\"$|\1|"
fi fi
} }