title: Cannot run shell script from java Command Line
body: <p>I'm trying to run this script shell from java, but it's not working.</p>
  
  <p>I get this error message: </p>
  
  <pre><code>Process exited with an error: 1 (Exit value: 1)
  </code></pre>
  
  <p>Can someone help?</p>
  
  <pre><code>String pwd = "blabla";
  
  String s_key = "0000";
  
  String path = "C:/Files/scripts"; 
  
  CommandLine commandLine = CommandLine.parse("C:\\Program Files (x86)\\Git\\bin\\git.exe");
  
  commandLine.addArgument("fileName.sh");
  
  commandLine.addArgument(password);
  
  commandLine.addArgument(s_key);
  
  DefaultExecutor defaultExecutor = new DefaultExecutor();
  
  ByteArrayOutputStream sdtout = new ByteArrayOutputStream();
  
  ByteArrayOutputStream sdterr = new ByteArrayOutputStream();
  
  PumpStreamHandler streamHandler = new PumpStreamHandler(sdtout, sdterr);
  
  defaultExecutor.setStreamHandler(streamHandler);
  
  defaultExecutor.execute(commandLine);
  </code></pre>
  
  <p>Here is the script </p>
  
  <pre><code>#!/bin/sh
  
  pwd=$1
  s_key=$2
  ....
  echo $pwd
  </code></pre>
  
  <p>it works well with git bash</p>
  
  <pre><code>  $ ./fileName.sh blabla 0000
    nkfjWmiG7dDnYUmjr6VD0A==
  </code></pre>