Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNG-7270] Switch to shell alternative to "which"
In some circumstances the init script calls `which`, which may or may not be available on the host system. Instead, use `command -v`, which is nearly equivalent. One area it differs is if the command being queried is defined as a shell alias. To avoid that, call `unset -f command` to avoid the situation where "command" has been re-defined as a shell function. See here for more information on this approach: <https://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html> Tested with bash, sh (bash invoked as sh), posh, dash, zsh and mksh. This closes #556
- Loading branch information