jsch でコマンドを発行しcd ../ && pwd
、結果が/home
次の場合。次回コマンドを実行すると、 ls
jsch の内容が出力されます。私は/home
そう期待しています..
Channel channel=session.openChannel("exec");
((ChannelExec)channel).setCommand("cd ../ && pwd");
channel.connect();
channel.run();
((ChannelExec)channel).setCommand("ls");