aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2011-09-19 09:31:11 +0300
committerMathias Bynens <mathias@qiwi.be>2011-09-19 09:31:11 +0300
commitc7a82c23677c63327ba8cd1f8c5da22ddde1fb0b (patch)
treee3318c8f606c0d8f7acb36cc80e77e6fe91d58da
parenta77f4872f26d681a35cface9d6bcb4ad55fec752 (diff)
downloaddotfiles-c7a82c23677c63327ba8cd1f8c5da22ddde1fb0b.tar.gz
dotfiles-c7a82c23677c63327ba8cd1f8c5da22ddde1fb0b.tar.bz2
dotfiles-c7a82c23677c63327ba8cd1f8c5da22ddde1fb0b.zip
Check if ~/.ssh/config exists before grepping it.
-rwxr-xr-x.bash_profile2
1 files changed, 1 insertions, 1 deletions
diff --git a/.bash_profile b/.bash_profile
index 06ab619..36ca384 100755
--- a/.bash_profile
+++ b/.bash_profile
@@ -9,7 +9,7 @@ done
shopt -s nocaseglob
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
-complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
+[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
# Add tab completion for `defaults read|write NSGlobalDomain`
complete -W "NSGlobalDomain" defaults \ No newline at end of file