Hi,
I'm working on NETCONF protocol implementation, which uses SSH as
transport layer. I make some testing around libssh2. I tried to use
standard command execution, shell execution and my own SSH subsystem.
I have lot of problems with shell, similar to yours. Finally I have
used separate reading
2009/9/25 bill marr :
>
> You are so right :-)
Glad I helped.
I hope this demonstrates the need to *always* post code.
Alex
___
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Alex,
You are so right :-)
Many Thanks.
> Date: Fri, 25 Sep 2009 08:29:13 +0100
> Subject: Re: using ssh2 on linux shell
> From: sw...@lammy.co.uk
> To: libssh2-devel@cool.haxx.se
>
> 2009/9/25 :
> >
> > QString testc
On Fri, 25 Sep 2009, bill_m...@hotmail.com wrote:
Please trim your quotes. Remove all the quotes that don't add anything to the
contents of your mail.
rc = libssh2_channel_read( channel, buffer, sizeof(buffer));
if( rc > 0 )
{
recvData = tr(buffer);
Ok, I don't know what tr() do
2009/9/25 :
>
> QString testcmd =ui->lineEdit->text()+"\r\n";
>
> libssh2_channel_write(channel,testcmd.toStdString().c_str(),sizeof(testcmd.toStdString().c_str()));
I don't know if this is the source of your problems but I very much
doubt you should be using sizeof here. sizeof is a *compile*
Sleep(1000);
int rc = libssh2_channel_read( channel, buffer, sizeof(buffer));
if( rc > 0 )
{
recvData = tr(buffer);
ui->textEdit->append(recvData);
recvData.clear();
memset(buffer, '\0', 4096);
}
ui->lineEdit->clear();
}
-
bill_m...@hotmail.com wrote:
> But command "ls -l", just response "ls -". (all of them I had
> added line feed after command string)
> The same server, the same shell commands, putty works well.
So use PuTTY?
Seriously, I am confident that all your shell problems are because
you are trying to c
2009/9/22 :
> On Sep 8, I got your suggestion about sending a line feed after command
> string to shell, the shell works well but with tiny matter.
> This time my question exactly is that in some cases shell not response the
> right string.
> For example,
> command "who", response what I want.
But command "ls -l", just response "ls -". (all of them I had added line
feed after command string)
The same server, the same shell commands, putty works well.
Could you take a look at my problem?
Thanks and Best Regards.
Bill.
------------
Hi again Bill,
bill_m...@hotmail.com wrote:
> For example, "ls -l" response "ls -", another "ls -l" response "ls -",
> but if followed "ls", response the format of "ls -l". The same to "cd .."
> response "cd .". It seems simple but not works.
Keep in mind that shells are created for humans. W
e "ls -",
but if followed "ls", response the format of "ls -l". The same to "cd .."
response "cd .". It seems simple but not works.
If I using API "libssh2_channel_exec()" and read response, It works.
-------------
Hi Bill,
bill_m...@hotmail.com wrote:
> I studied the example of libssh2.c, which using a shell.
>
> I can exe shell like "who", "ls" and so on , but not "cd .." or
> "ls -l", but they can exe on command mode, I do not why? Help?
> pls.
How do you think we can help you? How would we know
12 matches
Mail list logo