title: Running shell script from java code and pass arguments
body: <p>I am executing a shell script from Java program. I have implemented it using Runtime class. Below is the code I implemented</p>
  
  <pre><code>final StringBuilder sb = new StringBuilder("test.sh");
  sb.append("/path to/my/text file");
  
  final Process p = Runtime.getRuntime().exec(sb.toString());
  </code></pre>
  
  <p>Here sb is string buffer object where I append my parameters and use it in exec method. But the problem is the parameter I pass "/path to/my/text file" is considered as 4 parameters </p>
  
  <pre><code>/path
   to
  /my/text
   file
  </code></pre>
  
  <p>But if run in shell as test.sh "/path to/my/text file" which is taken as single parameter. How can I achieve the same using Java code, where I need to consider this path with spaces as single argument. Any please will be really appreciable.</p>