Hi,
I have a requirement where i have to fire module load command before submitting a job.
My Code sequence is as
SshClient client = new SshClient("0.0.0.0", "UN", "PWD"); client.Connect(); SshCommand cmd2 = client.CreateCommand("module list;");string output1 = cmd2.Execute(); SshCommand cmd = client.CreateCommand("module unload optistruct/optistruct10.0;");string output = cmd.Execute(); SshCommand cmd1 = client.CreateCommand("module list;"); output1 = cmd1.Execute(); client.Disconnect();
When my second "module list"command is executed the module is still is unloaded.
I googled it around and found
1. Although the connection is opened with the client, but the command to the client is routed through the different channel.
2. Since the channel is being changed everytime, i will not be able to get the desired result.
Can anybody help me in using the same channel for the multiple commands.
OR i will be left with the only option, where i have to fire all these command in a semi-colon seperated list.
Please reply soon