【问题标题】:Running a command remotely over ssh from power shell从 powershell 通过 ssh 远程运行命令
【发布时间】:2021-07-07 11:23:03
【问题描述】:

当我从机器本身运行这个 ./start.sh 脚本时,exe 运行良好。但是当我尝试使用不同 Windows 机器的 PowerShell 远程运行此命令时,我收到此错误:

**加载共享库时出错:libentity.so.5.4.beta:无法打开共享对象文件:没有这样的文件或目录

我曾尝试寻找相同的问题,但找不到。

PS C:\Users\Administrator> plink -pw tpstps iris@192.168.5.58 "./start.sh"

Running comms.exe

Running abc.exe

Running PM2
TERM environment variable not set.
./comms.exe: error while loading shared libraries: libentity.so.5.4.beta: cannot open shared object file: No such file or directory
./abc.exe: error while loading shared libraries: libboost_serialization.so.1.59.0: cannot open shared object file: No such file or directory

start.sh 文件:

echo
echo "Running comms.exe"
./comms.exe&

echo
echo "Running abc.exe"
./abc.exe&

echo
echo "Running PM2"
pm2 start

exit 0

【问题讨论】:

  • 看起来你的环境变量有问题。
  • 谢谢,问题已解决,我在执行 .sh 文件之前将源设置为我的 bash_profile。它就像一个魅力:)
  • 这能回答你的问题吗? Script via Plink in .bat behaves differently

标签: linux shared-libraries plink


【解决方案1】:

问题已解决,我必须在执行 .sh 文件之前将源设置为我的 bash_profile。现在,工作命令如下所示:

plink -pw tpstps iris@192.168.5.58 "source ~/.bash_profile; ./start.sh"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-26
    • 2019-02-08
    • 2011-09-19
    相关资源
    最近更新 更多