# Usage: find_working [options] <prog>
# Options: -A Don't test arguments to executable files.
# -a <args> Use arguments to test executable files. Default --help.
# Usage: find_working [options] <prog>
# Options: -A Don't test arguments to executable files.
# -a <args> Use arguments to test executable files. Default --help.
# -q Don't print path to prog. Just exit 0 if found.
# -x Don't try to execute unreadable files. Assume success.
# -X Don't try to execute unreadable files. Assume failure.
# -q Don't print path to prog. Just exit 0 if found.
# -x Don't try to execute unreadable files. Assume success.
# -X Don't try to execute unreadable files. Assume failure.
echo >&2 "Usage: find_working [options] <prog>"
echo >&2 "Options: -A Don't test arguments to executable files."
echo >&2 " -a <args> Use arguments to test executable files. Default --help."
echo >&2 "Usage: find_working [options] <prog>"
echo >&2 "Options: -A Don't test arguments to executable files."
echo >&2 " -a <args> Use arguments to test executable files. Default --help."
echo >&2 " -q Don't print path to prog. Just exit 0 if found."
echo >&2 " -x Don't try to execute unreadable files. Assume success."
echo >&2 " -X Don't try to execute unreadable files. Assume failure."
exit 1
fi
echo >&2 " -q Don't print path to prog. Just exit 0 if found."
echo >&2 " -x Don't try to execute unreadable files. Assume success."
echo >&2 " -X Don't try to execute unreadable files. Assume failure."
exit 1
fi
else
ldd "$path/$prog" 2>/dev/null | grep "not found" >/dev/null && continue
fi
ret="$path/$prog"
break
elif [ -z "$unreadable" ]; then
else
ldd "$path/$prog" 2>/dev/null | grep "not found" >/dev/null && continue
fi
ret="$path/$prog"
break
elif [ -z "$unreadable" ]; then