And only add /usr/local/sbin when other sbin directories are
already included in the path_helper generated path.
# Initialize PATH variable
if [ -x /usr/libexec/path_helper ]; then
- eval `/usr/libexec/path_helper -s`
+ eval `/usr/libexec/path_helper -s \
+ | sed "s|:/usr/local/bin||" | sed "s|:/usr/local/sbin||"`
+ [[ "$PATH" == *sbin* ]] \
+ && PATH="/usr/local/bin:/usr/local/sbin:$PATH" \
+ || PATH="/usr/local/bin:$PATH"
else
PATH="/usr/local/bin:/usr/bin:/bin"
[ "$UID" -eq 0 ] && PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH"