Going from a Linux host to another Linux host

说我跑:

ssh user@server ' . /etc/profile; /path/to/myScript.pl'

我总是在perl脚本中遇到涉及脚本的错误,比如......

/path/to/otherscript.sh was not found No Such File or Directory

  • 即使它显然在那里 . 在“服务器”上本地运行此脚本可以正常工作 . 令人困惑的是......的输出......

ssh user@server ' . /etc/profile; echo $PATH'

...在本地"server"上运行时,看起来与 echo $PATH 完全相同 .

关于为什么这不起作用的任何想法?我没有权限修改perl脚本以始终*包含列出的文件的完整路径 .

if it's useful 这是用#!/ usr / bin / env perl的shebang运行 - 现在读它,这会改变我的路径吗?**