summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-10-14 10:00:58 +0900
committerGitHub <noreply@github.com>2016-10-14 10:00:58 +0900
commit47b11cb8b48ae63399e7cc75e621a783ba217e15 (patch)
treef89fbdbbadc09cb139699ef895bf5c4d47c59ff0
parentac549a853ad4203f3e2601c9ca489b53e20ffeff (diff)
parentd3da310b926f1aa4c297d34d4157d064e4a7e379 (diff)
Merge pull request #701 from nthapaliya/zsh_script_improvements
[zsh] GNU coreutils compatibility
-rw-r--r--shell/completion.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh
index cef8afaf..0be5ad15 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -44,7 +44,7 @@ __fzf_generic_path_completion() {
setopt localoptions nonomatch
dir="$base"
while [ 1 ]; do
- if [ -z "$dir" -o -d ${~dir} ]; then
+ if [[ -z "$dir" || -d ${~dir} ]]; then
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
[ -z "$dir" ] && dir='.'
@@ -111,7 +111,7 @@ _fzf_complete_telnet() {
_fzf_complete_ssh() {
_fzf_complete '+m' "$@" < <(
- cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*') \
+ command cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*') \
<(command grep -oE '^[^ ]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \
<(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |
awk '{if (length($2) > 0) {print $2}}' | sort -u