Not able to execute (Unix)commands containing variables using JSch library : I have written a Java program which when executed would open an upload wizard through which a user can select a file. After doing this, the selected file would be transferred/uploaded to a Unix box to a directory which the user specifies and processed further.  <br>
Here are the steps/actions:  <br>
1. Browse the file through the upload wizard. <br>
2. After this the program would prompt for a new directory to be created, the name of which the user can give as an input. <br>
3. The program creates a new directory(source) and places the selected file in the created directory of the server. <br>
4. Show the contents of the transferred file in the source(using cat command). <br>
5. Prompt the user for a new directory to be created(target), copy the file from the source to target and subsequently show the contents of the file in the target(All Linux commands). <br><br>
I'm able to upload the file to the source(upto hte 1st 3 steps). However, the 4th and the 5th don't work. Here's the code which doesn't seem to work: <br><br>


String cmd1 = "cat" + " " + path + s1 + "/" + file;
																
																System.out.println(cmd1);
                                                                
                                                                ((ChannelExec)channel).setCommand(cmd1);
																	 
                                                                Scanner in2 = new Scanner(System.in);

                                                                System.out.println("Enter d target directory");

                                                                String s = in2.nextLine();
                                                                
                                                                String path2 = "/e/f/";

                                                                String d = path2 + s;
                                                                
                                                                String cmd2 = "mkdir" + " " + path2 + s;
                                                            
                                                                ((ChannelExec)channel).setCommand(cmd2);
																
                                                                String src = p + "/" + file;
                                                                
                                                                String cmd3 = "cp" + " " + path + s1 + "/" + file + " " + path2 + s;
                                                                
                                                                ((ChannelExec)channel).setCommand(cmd3);
																
                                                                String destpath = d + "/" + file;
                                                                
                                                                String cmd4 = "cat" + " " + path2 + s + "/" + file;
