diff --git a/cd.sh b/cd.sh index 3161651..29060d7 100644 --- a/cd.sh +++ b/cd.sh @@ -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 () {