[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to run commands under non-interactive shell


 Hi, guys. I have unsubscribed from news posting. But your letters always come to me :angry:. Please unsubscribe me again. Thanks.


>

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





-- 

С уважением,

 aleksey                          mailto:joomcod@xxxxxxxxx


References:
How to run commands under non-interactive shellHuang Yaolong <airekans@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org