same here which is not portable

Use this (best pratice)

pathfind() {
    OLDIFS="$IFS"
    IFS=:
    for p in $PATH; do
        if [ -x "$p/$*" ]; then
            IFS="$OLDIFS"
            return 0
        fi
    done
    IFS="$OLDIFS"
    return 1
}


On Sat, Aug 15, 2015 at 11:25 PM, Barak A. Pearlmutter
<ba...@pearlmutter.net> wrote:
> if which mktemp > /dev/null; then

Reply via email to