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:
0900336
)
Detect old bash which can't do completion.
author
Iain Patterson
<me@iain.cx>
Tue, 1 Sep 2009 10:56:55 +0000
(11:56 +0100)
committer
Iain Patterson
<me@iain.cx>
Wed, 16 Sep 2009 15:39:01 +0000
(16:39 +0100)
.profile.d/completion.bashrc
patch
|
blob
|
history
diff --git
a/.profile.d/completion.bashrc
b/.profile.d/completion.bashrc
index
775c208
..
0f71b59
100644
(file)
--- a/
.profile.d/completion.bashrc
+++ b/
.profile.d/completion.bashrc
@@
-1,3
+1,6
@@
+# Old bash doesn't have completion support.
+if ! builtin complete 2>&1 | grep 'not a shell builtin' >/dev/null; then
+
# Helper!
export COMPLETION_DIR_SSH=~/.ssh/hosts
export COMPLETION_DIR_TELNET=~/.telnet/hosts
@@
-129,3
+132,5
@@
complete -F _known_hosts knh
complete -F _modprobe modprobe
complete -F _rmmod rmmod
complete -F _global global
+
+fi