diff --git a/share/config.fish.in b/share/config.fish.in index c0bfd247f..d0aec60fe 100644 --- a/share/config.fish.in +++ b/share/config.fish.in @@ -62,14 +62,11 @@ switch $USER set path_list $path_list /sbin /usr/sbin /usr/local/sbin 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/.\$//")\) - -for i in (printf "%s\n" $path_list|sgrep -E -v $path_regexp) - if test -d $i - set PATH $PATH $i +for i in $path_list + if not contains $i $PATH + if test -d $i + set PATH $PATH $i + end end end