From b38417294fa9a0cb15c0a07e66662251b9c495b9 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Mon, 12 Feb 2024 18:10:17 -0800 Subject: [PATCH] load adds a 'which' function if 'which' command is missing --- load.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/load.sh b/load.sh index 45e5242..2f9b50d 100755 --- a/load.sh +++ b/load.sh @@ -65,6 +65,12 @@ unset BASH_SHELL_LOADED module_load shell-process-directory +if ! command -v which > /dev/null; then +echo missing "which" command install package +which () { command -v "$1"; } +fi + + # if [[ $SSH_SESSION ]]; then # # ssh session only process base by default # # env | grep SSH