繁体   English   中英

如何通过SSH运行Shell脚本,以使远程计算机的环境与本地计算机的环境相似?

[英]How can I run a shell script via SSH such that the environment of the remote computer is similar to that of the local computer?

我欢迎改写我的问题,因为我不确定问题到底是什么。

我正在尝试使用以下格式的命令通过SSH运行Shell脚本:

ssh -o StrictHostKeyChecking=no lxplus0035 "cd ~/test; bash script1.sh"

当我这样做时,复杂的脚本script1.sh会因许多语法错误,操作数错误和其他错误而中断。 示例如下:

stty: standard input: Invalid argument

当在本地系统和远程系统中(而不是通过SSH会话连接)直接而不是通过SSH运行时,该脚本可以正常工作。 为什么通过SSH执行脚本会导致这些问题?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM