分类: 系统运维
2015-07-27 16:02:34
ssh 远程执行脚本,结果提示mvn not found. 登陆机器看env是
PATH=/usr/local/zuora64/jdk/bin:/usr/local/zuora64/bin:/usr/local/bin:/bin:/usr/bin
-l make bash act as if it had been invoked as a login shell (see INVOCATION below).
PATH=/home/zapp/apache-maven-3.0.5/bin:/usr/local/git/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
而 ssh host "env"却是:
原来是user的profile必须在登陆后才能加载,解决办法是:
ssh host "bash -l -c \"cmd\""