我正在尝试使用 GNU Parallel 在远程机器上运行带有多个参数的脚本。这看起来有点像:
parallel --onall -S remote-machine /shared/location/script.sh ::: param_a param_b
/shared/location/script.sh正在使用 git。所以我得到这个错误:
git: command not found
remote-machine如果我手动登录并运行/shared/location/script.sh,param_a或者param_b一切正常。所以我检查了 $PATH 变量,发现如果我remote-machine使用 GNU 并行运行某些东西,它看起来像PATH=/usr/bin:/bin:/usr/sbin:/sbin. 如果我直接从机器上运行它,它也有/local/bin/git.
为什么会这样,如何克服?
提前致谢