[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to run commands under non-interactive shell
[Thread Prev] | [Thread Next]
- Subject: How to run commands under non-interactive shell
- From: Huang Yaolong <airekans@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Tue, 10 Jul 2012 15:51:50 +0800
- To: libssh@xxxxxxxxxx
Hi, all. How can I run a command under non-interactive shell? I don't want the redundant echo output of pty, and all I want is the output from the command I run and maybe I would interrupt this command. By doing the following, the command will not run. Notice that I was using the C++ wrapper: execChannel->requestShell(); const string realCommand = command + "\n"; const int count = execChannel->write(realCommand.c_str(), realCommand.size()); after doing the above, I read from the channel, but it will block there because the command did not run yet. How can I run the command specified? If I request a pty, I can run the command correctly. -- Best regards, Yaolong Huang(Curtis) Briontech China
Re: How to run commands under non-interactive shell | aleksey <joomcod@xxxxxxxxx> |