8 nopath - Run command by disregarding some PATH directories
12 nopath [-r|--recursive] I<DIRLIST> I<COMMAND> [I<ARGS>]
16 Run I<COMMAND> by looking up directories in C<PATH> environment variable
17 as usual, except ignore those directories which are given in colon-delimited list, I<DIRLIST>.
19 Useful in situations like you have a wrapper command X which runs the "real" command X and
20 don't want to burn in the wrapped command's full path, but keep relying on PATH-lookup mechanisms.
31 .
/usr
/lib
/tool
/bash-utils
49 errx
-1 "unknown option: $1";;
57 declare -a nopaths
=($1)
58 declare -a sys_paths
=($PATH)
65 for dir
in ${sys_paths[@]}
67 if ! in_list
"$dir" "${nopaths[@]}" && ! in_list "$dir/" "${nopaths[@]}" && ! in_list "${dir//%+(\/)}" "${nopaths[@]}"
73 PATH
=`bash_join : "${paths[@]}"`
79 exec env PATH
="$sys_path" "$@"