diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2019-01-24 01:11:01 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2019-01-24 01:11:01 +0300 |
commit | 938b0d49a13c2d69181595234e9eda4d72049396 (patch) | |
tree | d70086360679e1dca62d6ac9153cf2fd0481d2f1 /functions | |
parent | 735994f82ea47118aa31278af1c9a596d35469ed (diff) |
Avoid externals when parsing the os release on linux
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/utilities.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh index cedf5493..95f89d99 100755 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -103,7 +103,7 @@ case $(uname) in Linux) OS='Linux' if [ -f /etc/os-release ]; then - os_release_id="$(grep -E '^ID=([a-zA-Z]*)' /etc/os-release | cut -d '=' -f 2)" + [[ ${(f)"$((</etc/os-release) 2>/dev/null)"} =~ "ID=([A-Za-z]+)" ]] && os_release_id="${match[1]}" fi case "$os_release_id" in *arch*) |