From 9c4c579938a4fbe549b6d2fe0086d098e28e7a90 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Thu, 25 Feb 2021 19:41:34 +0100 Subject: [PATCH] bash: improve operating system detection The -s flag to `uname` makes sure that only the string "Darwin" is printed, so the comparison is safer. --- files/bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/bashrc b/files/bashrc index 64119e4..ffaf961 100644 --- a/files/bashrc +++ b/files/bashrc @@ -32,7 +32,7 @@ export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py" # See: https://superuser.com/a/583502 # shellcheck disable=SC2123 # PATH is being intentionally manipulated here. # shellcheck disable=SC1091 # /etc/profile is provided by macOS. -[ "$(uname)" == "Darwin" ] && { PATH=""; source /etc/profile; } +[ "$(uname -s)" == "Darwin" ] && { PATH=""; source /etc/profile; } _prepend_path() { # prepend $1 to var $2 avoiding duplicates using : as separator if [ -d "$1" ] && [ -n "$2" ]; then