title: How to pass parameter to shell script in java program
body: <p>i am trying to run this java code that calls the shell script on runtime.</p>
  
  <p>when i run the script in terminal i am passing argument to script</p>
  
  <p>code:</p>
  
  <pre><code>./test.sh argument1
  </code></pre>
  
  <p>java code:</p>
  
  <pre><code>public class scriptrun
      {
          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();
                  }
              }
      } 
  </code></pre>
  
  <p>How to pass argument for script in java code?</p>