且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过SSH在远程服务器上执行命令

更新时间:2023-11-11 20:19:28

您的PATH的设置在交互式shell(=在服务器上登录时)和非交互式(使用ssh).

Your PATH is setup differently when your shell is interactive (= when you are logged in on the server), and when not interactive (running commands with ssh).

查看外壳程序使用的rc文件,例如.bashrc.bash_profile.profile(取决于您的系统).如果将PATH设置在正确的位置,那么当通过ssh运行ttisql时,它可以工作.

Look into the rc files used by your shell, for example .bashrc, .bash_profile, .profile (depends on your system). If you set PATH at the right place, then ttisql can work when you run it via ssh.

另一种解决方案是使用ttisql的绝对路径,这将不取决于您的PATH设置.

Another solution is to use the absolute path of ttisql, then it will not depend on your PATH setup.