.bashrc: test if ls --color works before aliasing
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 27 Sep 2010 17:33:55 +0000 (10:33 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 27 Sep 2010 17:33:55 +0000 (10:33 -0700)
.bashrc

diff --git a/.bashrc b/.bashrc
index 6e3606e..b0df65b 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -23,7 +23,7 @@ xlock2() {
 case $- in
 *i*)
        # interactive shell
-       alias ls='ls --color=auto'
+        ls --color /tmp &>/dev/null && alias ls='ls --color=auto'
        alias mv='mv -i'
        alias vi='vim'
        alias wget='wget --user-agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"'