From c7a82c23677c63327ba8cd1f8c5da22ddde1fb0b Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Mon, 19 Sep 2011 09:31:11 +0300 Subject: Check if ~/.ssh/config exists before grepping it. --- .bash_profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.bash_profile') 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 -- cgit v1.2.3