Dear Peter,
Thanks for your suggestion and timely mail.
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.( "who" + "real response" + "shell
prompt" )
command "ls" , response with two "shell prompt".( "ls" + "real response" +
"shell prompt" + "shell prompt" )
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.
--------------------------------------------------
From: "Peter Stuge" <[email protected]>
Sent: Tuesday, September 22, 2009 1:04 AM
To: <[email protected]>
Subject: Re: using ssh2 on linux shell
Hi again Bill,
[email protected] 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. When humans send
commands to a shell, they type the command and then they press enter.
If you program wants to use the shell's human interface, you must
make sure that your program behaves like a human.
It sounds like you are not sending a line feed.
(This exact problem came up on the list only a week or two ago. Did
you look around in the archives? Can they be changed to more easily
help you find answers?)
//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel