title: how to pass password to a command in bash
body: <p>I want to write a bash script that will execute one command in the script, and the command need read some thing as password. So how can I pass the password to the command in the script?</p>
  
  <pre><code>$ota_gen -k $ota_key -i $1 -p $ota_tools $2 $ota_out_file
  </code></pre>
  
  <p>ota_key is a private key that need to be visited with a password, so how can I do it?
  thank you.</p>
  
  <p>ps: thanks  hlovdal for help.
  expect maybe what can help. But I don't know if it can interact with bash script, such as how to pass parameters from script to expect.</p>