Saturday, January 30, 2010

Java Tip

It is better to call shell command (having multiple spaces) by passing all arguments using a string array.


For e.g.

try{


         String myCmd[]={"command","dest","src"};
         shell.exec(myCmd);

}catch(Exception e){

        System.out.println(e.getMessage());

}


No comments:

Post a Comment