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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -