从 plasmoid 执行特定命令
我正在编写一个远程控制 Plasmoid,我希望它通过 ssh 向远程主机发送某些命令,我已经尝试过了:
QProcess p;
p.start("/home/user/bin/command");
p.waitfForFinished(-1);
其中 command
是一个脚本,
#!/bin/bash
ssh user@remote_host remote_command &> /dev/null &
我也尝试过使用
KRun::run(QString("/home/user/bin/command"), NULL);
它,但它什么也没做,也许我使用它的方式错误? 有什么建议吗?
I'm writing a Remote Control Plasmoid, I want it to send certain commands over ssh to a remote host, I've tried:
QProcess p;
p.start("/home/user/bin/command");
p.waitfForFinished(-1);
where command
is a script which has
#!/bin/bash
ssh user@remote_host remote_command &> /dev/null &
I've also tried using
KRun::run(QString("/home/user/bin/command"), NULL);
but it does nothing, perhaps I'm using it the wrong way?
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我的问题是我没有正确连接信号,现在我已经做到了,并且这部分代码工作完美。
此致!
OK, my problem was that I didn't connect the signals correctly, now I've done that and this part of code works perfectly.
best regards!