From: W. Trevor King Date: Wed, 30 Nov 2011 21:04:16 +0000 (-0500) Subject: Oops, grep returns 0 when it finds a match. Update .bashrc.d/01detect_system accordi... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b08107c3e9ddc16f1e4b0bd9cfd2c126f42f806f;p=dotfiles-public.git Oops, grep returns 0 when it finds a match. Update .bashrc.d/01detect_system accordingly. --- diff --git a/src/.bashrc.d/01detect_system b/src/.bashrc.d/01detect_system index bce8321..df8b7f3 100644 --- a/src/.bashrc.d/01detect_system +++ b/src/.bashrc.d/01detect_system @@ -9,9 +9,9 @@ if [ -z "${OS}" ]; then export OS='Gentoo' elif [ "${SHELL#*gentoo}" != "${SHELL}" ]; then # assumes 'gentoo' in prefix export OS='Gentoo Prefix' - elif ! grep -i debian /etc/issue; then + elif grep -i debian /etc/issue > /dev/null 2>&1; then export OS='Debian' - elif ! grep -i ubuntu /etc/issue; then + elif grep -i ubuntu /etc/issue > /dev/null 2>&1; then export OS='Ubuntu' else echo "unknown system. Adjust .bashrc.d/01detect_system or set OS by hand" >&2