java - What is the difference between the 'shell' channel and the 'exec' channel in JSch -
i want able send many consecutive command represented strings within java application ssh server execution. should use:
channel channel = session.openchannel("shell");
-or-
channel channel = session.openchannel("exec");
with shell channel shell (on unix it's sh or bash or that, on windows it's cmd.exe) started , console created (the same see on screen if run them locally). have prompt can parse or use detection of completion of command.
with command channel shell instance started each command (actually channel opened each command) , command passed parameter shell (on windows "cmd.exe /c ".
it's easier use command channel cause don't need deal command prompt.
Comments
Post a Comment