Oops, grep returns 0 when it finds a match. Update .bashrc.d/01detect_system accordi...
authorW. Trevor King <wking@drexel.edu>
Wed, 30 Nov 2011 21:04:16 +0000 (16:04 -0500)
committerW. Trevor King <wking@drexel.edu>
Wed, 30 Nov 2011 21:04:16 +0000 (16:04 -0500)
src/.bashrc.d/01detect_system

index bce8321f46ef93dc32d7f9e70248dc4d8390d5e6..df8b7f38392ad4cb45d9c11bc046931341c494a4 100644 (file)
@@ -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