From 470774687d1bab90856a4053982fc1e39c30c9d3 Mon Sep 17 00:00:00 2001 From: Ray Huang <47706097+ExplorerRay@users.noreply.github.com> Date: Thu, 3 Oct 2024 01:15:35 +0800 Subject: [PATCH] fix 'command -v' not in csh (#45845) --- share/spack/setup-env.csh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/spack/setup-env.csh b/share/spack/setup-env.csh index 14dcee56b79..d091caf8dd9 100644 --- a/share/spack/setup-env.csh +++ b/share/spack/setup-env.csh @@ -62,9 +62,9 @@ if (! $?SPACK_PYTHON) then setenv SPACK_PYTHON "" endif foreach cmd ("$SPACK_PYTHON" python3 python python2) - command -v "$cmd" >& /dev/null + set status=`which "$cmd" >& /dev/null; echo $?` if ($status == 0) then - setenv SPACK_PYTHON `command -v "$cmd"` + setenv SPACK_PYTHON `which "$cmd"` break endif end