This project is read-only.

Keeping same session/channel between distinc commands execution

Mar 30, 2013 at 7:03 PM
Hi,

I would like to run two related commands. For instance:
  1. cd /
  2. dir
I saw that each RunCommand call resets the SSH session so the second command won't have the same session as the first one.

Is it possible to keep the session/channel open, so two commands will be executed within the same session?

Thanks,
Nick
Coordinator
Apr 2, 2013 at 1:54 AM
Hi,

I am afraid it it is not possible due to server implementation.

One command execution cannot remember command execution results.
You can either execute one long command, which could be series of semicolon separated commands or look into using shell.

Hope it helps,

Thanks,
Oleg
Apr 2, 2013 at 3:24 PM
You can do this with shell, as long as you seperate the commands with a ";" (in unix anyways)
ex: I do this all the time with my code
cd <somedir>;grep stuff <filename>