且构网

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

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

更新时间:2023-11-11 20:33:34

你的 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).

查看你的shell使用的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.