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



On May 29, 5:18 pm, Simon Tatham <ana...@xxxxxxxxx> wrote:
yawnmoth <terra1...@xxxxxxxxx> wrote:
What would the protocol flag for such a keepalive be? SSH_MSG_IGNORE?

Yes.

Also, say I want to execute an 'ls' on the server. As far as I know,
the only way to do this is to request a pty and then to start a
shell. You then send the command 'ls' in, via stdin, and read the
output via stdout. A problem with this method, however, is that you
have no way of knowing when ls's output is done.

Yes, so don't do it like that. Instead of starting a shell using
SSH_CMSG_EXEC_SHELL, you use SSH_CMSG_EXEC_CMD and send "ls" as the
command string in that packet. Then you know when the output is done
because the server will close the data channel and also send you
SSH_SMSG_EXITSTATUS.
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?

.



Relevant Pages

  • Bash-4.0 available for FTP
    ... Unlike previous bash distributions, this tar file includes the formatted ... The shell has been changed to be more ... rigorous about parsing commands inside command substitutions, ... Changes have been made to the Readline library being released at ...
    (gnu.announce)
  • Why newbies dont RTFM...
    ... Even though I've used Linux before, I've never had to do any ... BASH BUILTIN COMMANDS ... last command exited within ... unless the shell is not exeâ ...
    (comp.os.linux.misc)
  • Re: Great SWT Program
    ... None of the nasty things that you have said or implied about me are at ... treat the file as input (manually invoking the command interpreter ... script, copy the line into that within the editor, exit, and invoke ... the shell script. ...
    (comp.lang.java.programmer)
  • Re: Shell function - accessing an Access secure db (.MDW file)
    ... > Hi - Does anyone know the correct syntax for the shell function. ... You can use the Shell command. ... To execute internal DOS command (Dir, Copy, ... Private Declare Function OpenProcess _ ...
    (microsoft.public.vb.general.discussion)
  • Re: ksh silently ignores function if mistakenly not autoloaded
    ... Here's the order of execution. ... This really takes place prior to command ... Shell scripts, with all their power, have one major drawback - they ... In the Korn Shell, there are two separate syntaxes for defining ...
    (comp.unix.shell)