login about faq

What is the difference between SendReqExec and SendReqShell? Both send commands to be executed remotely..

asked Apr 24 '15 at 08:58

chilkat's gravatar image

chilkat ♦♦

The SendReqExec command is equivalent to doing an "rexec" (http://linux.die.net/man/1/rexec).

It's not the same as establishing a remote shell as in this example: http://www.example-code.com/vcpp/ssh_remote_command.asp

A remote shell SSH session is where a remote shell is established. The output received back to the SSH client includes the command prompt. Commands are sent one after the other just as they are typed, with a "n" or "rn" terminating the command, and the command output is received back along with the next command prompt. It's the equivalent of a shell session where the SSH client (your app) is the human at the keyboard. (see the detailed answer to this Chilkat forum post: http://www.chilkatforum.com/questions/1272/how-to-get-the-full-output-of-an-ssh-command )

A remote command is entirely different. It's a single command sent without "n" or "rn" because it's not the equivalent of being the human at the keyboard. You send the command, such as "ls", and get the response, which does not include the shell prompt. You can only do a single rexec (i.e. SendReqExec) in a session channel. To execute the next rexec, you would close the session channel, open a new one, and issue the next rexec. There is no "state". It wouldn't makes sense to "cd" to a directory in one rexec, and then do another rexec assuming you are now in that directory. A "cd" only makes sense if you are in a remote shell. If the rexec command produces no output, such as a "cd" command would output nothing, then there is no output to receive. It still executed the command remotely, but for no reason.


answered Apr 24 '15 at 08:59

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Apr 24 '15 at 08:58

Seen: 1,055 times

Last updated: Apr 24 '15 at 08:59

powered by OSQA