title: Redirect input to a Java application inside a bash script
body: <p>I am using the ftm cli by Oracle. When I run a command, it asks for a password by saying "Enter a password". I am writing a script which uses this command and so I want to enter the password programatically.
  Here's what I have tried - </p>
  
  <pre><code>echo "password" | java -jar ftmcli.jar list
  </code></pre>
  
  <p>But this doesn't work. Any idea what to do to make it work?</p>