diff --git a/share/fish.in b/share/fish.in index ccf9ca372..df3433bc4 100644 --- a/share/fish.in +++ b/share/fish.in @@ -55,11 +55,10 @@ end # Make a regular expression that matches any component in the PATH. A # trailing slash is ok. The sed call is to remove the last '\|'. +set -l tmp (printf "%s" \^$PATH'/?$|') +set -l path_regexp \((echo $tmp | sed -e "s/.\$//")\) - -set -l path_regexp \\\((printf "%s" \^$PATH'\(\|/\)$\|' | sed -e "s/..\$//")\\\) - -for i in (printf "%s\n" $path_list|grep -v $path_regexp) +for i in (printf "%s\n" $path_list|grep -E -v $path_regexp) if test -d $i set PATH $PATH $i end @@ -109,7 +108,7 @@ end # Completions for the shell and it's builtin commands and functions # -for i in (builtin -n|grep -v '\(while\|for\|if\|function\|switch\)' ) +for i in (builtin -n|grep -E -v '(while|for|if|function|switch)' ) complete -c $i -s h -l help -d "Display help and exit" end