1
在jsch如果我們發出命令cd ../ && pwd
,如果結果是/home
。接下來的時間,如果我執行命令ls
將jsch輸出我/home
。我的內容不想到這麼..jsch更改目錄和獲取內容
Channel channel=session.openChannel("exec");
((ChannelExec)channel).setCommand("cd ../ && pwd");
channel.connect();
channel.run();
((ChannelExec)channel).setCommand("ls");