diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-11 16:59:44 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-05-11 16:59:44 +0900 |
commit | c14aa99ef6c7514cae2aebaa2cbdd630cd1b7961 (patch) | |
tree | 682b87a6eb8ca0b5f476a9c6673a112eb8c07b16 | |
parent | 8f371ee81c4686a094dac9e8b9e48b75ddc648ee (diff) |
[zsh/bash-completion] Avoid caret expansion
Close #233
setopt extendedglob on zsh caused caret in grep pattern to be expanded.
Problem identified and patch submitted by @lazywei.
-rw-r--r-- | shell/completion.bash | 2 | ||||
-rw-r--r-- | shell/completion.zsh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/shell/completion.bash b/shell/completion.bash index 49781c0e..ac8198e9 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -189,7 +189,7 @@ EOF _fzf_ssh_completion() { _fzf_list_completion '+m' "$@" << "EOF" - cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | \grep -i ^host | \grep -v '*') <(\grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0') | awk '{if (length($2) > 0) {print $2}}' | sort -u + cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | \grep -i '^host' | \grep -v '*') <(\grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0') | awk '{if (length($2) > 0) {print $2}}' | sort -u EOF } diff --git a/shell/completion.zsh b/shell/completion.zsh index 9dc4ce01..90350115 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -82,7 +82,7 @@ EOF _fzf_ssh_completion() { _fzf_list_completion "$1" "$2" '+m' << "EOF" - cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | \grep -i ^host | \grep -v '*') <(\grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0') | awk '{if (length($2) > 0) {print $2}}' | sort -u + cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | \grep -i '^host' | \grep -v '*') <(\grep -v '^\s*\(#\|$\)' /etc/hosts | \grep -Fv '0.0.0.0') | awk '{if (length($2) > 0) {print $2}}' | sort -u EOF } |