Re: keepalive's in SSH-1 and when to stop reading data

yawnmoth <terra1024@xxxxxxxxx> wrote:
According to the specs, "[SSH_SMSG_EXITSTATUS is] the last message
sent by the server". As such, I have to wonder... is it possible to
execute two commands like this? eg. can you get the output for an ls
and then for a pwd without having to wait, unsure of whether or not
you've reached the end?

Probably not very easily, no. This is one of the inconvenient things
about SSH-1 which was rectified in SSH-2: in SSH-2 you can open
multiple session channels, sequentially or simultaneously or both,
in a single SSH connection.

You could do something really hideous involving running a helper
program on the server side which would run two commands and
packetise their output so you could separate it when it reached you,
but that would depend on having that program available on whatever
server you wanted. (Though you might get away with making it a
longish Perl one-liner...)

If you can possibly arrange to upgrade to SSH-2, that's probably a
better plan.
Simon Tatham "_shin_, n. An ingenious device for
<anakin@xxxxxxxxx> finding tables and chairs in the dark."