Hi all,
I would like to execute a shell script from my java code. Can some one please tell me if that is possible? Here's what I tried, but with no result.
public class RunPDCC
{
public static void main(String[] args)
{
try
{
Process proc = Runtime.getRuntime().exec("./test.sh");
System.out.println("Print Test Line.");
}
catch (Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
In this program, I try to run the "./test.sh" shell script, which-for now-I have, just (echo "Hellow World"). But it doesn't seem that the script runs from within my code.
Can some one please tell me if I am in the right track, and how/if I am able to run the script from within my Java code....
Thanks and regards,