cd_grep_os

This commit is contained in:
Marc Beninca 2024-05-03 12:42:35 +02:00
parent add6886d09
commit 3abf55f721
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

9
cd.sh
View file

@ -324,8 +324,13 @@ local variable="${1}"
exit 2
}
cd_get_string () {
[ "${1}" ] && echo "${1}" | cut -d "=" -f 2 | cut -d "\"" -f 2
cd_grep_os () {
local variable="${1}"
if [ "${variable}" ] ; then
grep "^${variable}=" "/etc/os-release" \
| sed "s|^${variable}||" \
| sed "s|^\"\(.*\)\"$|\1|"
fi
}
cd_install_package () {