On Fri, Mar 4, 2011 at 1:26 AM, Jose Baars <peut_at_peut.org> wrote:
> Op 3/3/2011 2:06 PM, Naveen Sharma schreef:
>
>> In a typical ssh session, a user will give "1" and will press enter
>> and will enter the shell.
>
>>rc = libssh2_channel_write(channel, "1", strlen("1"));
>
> Where is the 'enter'? Wouldn't you want to write "1\n" or "1\r\n"?
>
> rc = libssh2_channel_send_eof(channel);
>
> Why close the channel? Do just want to press 1 and then stop doing anything
> useful?
>
> I must admit I didn't try this out myself, but this just doesn't look
> right from your description.
>
Hi Jose,
That worked for me. :)
Actually previously I was trying libssh2_channel_exec() and was giving "1\n",
but then I realized that this will not work for me and I stared using
a libssh2_channel_shell() and libssh2_channel_write() to interact with
the shell.
And I never tried "1\n" in this case. Its been a week I tried several
combination but this one. :(
Anyway, you guys are great!!!
Thanks Jose and Peter for helping me out.
Naveen.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-03-04