Subject: Re: shell exec and parseing

Re: shell exec and parseing

From: A. Mark <gougolith_at_gmail.com>
Date: Fri, 29 Jan 2010 06:39:51 -0800

Thanks for your input Peter !

On Thu, Jan 28, 2010 at 10:38 PM, Peter Stuge <peter_at_stuge.se> wrote:

> Sorry, but this is totally off-topic here.
>

I realize that, except that this is concerning a shell running from the
libss2 library and I wasn't sure if there was anything
in the lib to handle this kind of issue. I guess the answer is no and thus
I'm on my own.

> interface" - which means it is such a waste of time to try to "remote
> control" it from another program.
>

I'm not trying to remote control the shell, I'm just trying to see if i can
easily check process status of my app running in the shell, but I understand
your point.

> To come on topic a little, you could have one SSH channel and exec
> per command, and easily have client state per command, as well as an
> easy way to detect when programs terminate.
>

I have been using this method for a while now and it works ok, except that
starting and closing the channel seems to take a lot longer than having a
shell and just issuing commands, so the latter seems like a more stable
alternative. (Especially if i have to start the app many times over in
succession.)

Well, it can at least be made a little bit easier than that. :) Read
> into a buffer and try using sscanf instead.
>

Yes, I've tried this approach but for some reason I could not get it to work
as I was loosing parts of the messages every time, but I'll try again now
that I know it's doable. Thanks for taking the time to answer my questions
Peter!

A.MArk

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-01-29