From: Iain Patterson Date: Mon, 5 Aug 2013 14:02:31 +0000 (+0100) Subject: Don't rely on tty. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=a35e8ca463e14772e3634291187553567bdc77f1;p=profile.git Don't rely on tty. The tty command may not always be available. Use the builtin test -t 0. --- diff --git a/.bash_profile b/.bash_profile index a89f59e..6fe0759 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,4 +1,4 @@ -if tty -s || [ "${0:0:1}" = "-" -o "$1" = "force" ]; then +if [ -t 0 -o "${0:0:1}" = "-" -o "$1" = "force" ]; then # Remember if nocaseglob was on. shopt -q nocaseglob nocg=$? diff --git a/.bashrc b/.bashrc index 3d80825..5f4fdb5 100644 --- a/.bashrc +++ b/.bashrc @@ -1,4 +1,4 @@ -if tty -s; then +if [ -t 0 ]; then . /etc/profile . ~/.bash_profile fi