From f439c4a4840f1a2863064915e09beb54ef86c9c5 Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 31 Jul 2006 10:33:54 +1000 Subject: [PATCH] Make calls to grep Posix compliant darcs-hash:20060731003354-ac50b-5916d6d862fe8b4f31b64840296d24615b52d175.gz --- share/fish.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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