Running Shell Script from Java

Hi

How can I call a .sh (shell script) from a java procedure? Is this possible at all?
Please tell me.

Thanks.
Asty

use the java.lang.Runtime's exec() method.

here is the small piece of code....

try
{
  String execString = "ls -all" 
  Runtime r t            = Runtime.getRuntime();
  Process proc        = rt.exec(execString);
  
  /* handle you process from here..  
  outputstreams, inputStreams and such
 */
 
} 
catch (Exception e)
{
  e.printStackTrace()
}

if you face any problem go there
shell script from java

Thanks I got it!