javasundaram
javasundaram

Reputation: 967

how to run shellscript with argument through java

i'm trying to execute shellscript with args program through java

   String[] cmd = { "bash", "-F", "/home/admin/Desktop/test_full_incremental.sh" };
    Process p = Runtime.getRuntime().exec(cmd);

Upvotes: 1

Views: 55

Answers (1)

Arturo Volpe
Arturo Volpe

Reputation: 3627

You need to change the order of the parameters, try this:

 String[] cmd = { "bash", "/home/admin/Desktop/test_full_incremental.sh", "-F" };

Upvotes: 1

Related Questions