From a35e8ca463e14772e3634291187553567bdc77f1 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 5 Aug 2013 15:02:31 +0100 Subject: [PATCH] Don't rely on tty. The tty command may not always be available. Use the builtin test -t 0. --- .bash_profile | 2 +- .bashrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.7.4