git://git.iain.cx/iain
/
profile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3abab8
)
Don't rely on tty.
author
Iain Patterson
<me@iain.cx>
Mon, 5 Aug 2013 14:02:31 +0000
(15:02 +0100)
committer
Iain Patterson
<me@iain.cx>
Fri, 4 Oct 2013 11:08:28 +0000
(12:08 +0100)
The tty command may not always be available. Use the builtin test -t 0.
.bash_profile
patch
|
blob
|
history
.bashrc
patch
|
blob
|
history
diff --git
a/.bash_profile
b/.bash_profile
index
a89f59e
..
6fe0759
100644
(file)
--- 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
(file)
--- a/
.bashrc
+++ b/
.bashrc
@@
-1,4
+1,4
@@
-if
tty -s
; then
+if
[ -t 0 ]
; then
. /etc/profile
. ~/.bash_profile
fi