title: Passing inputs to multiple commands in bash script
body: <p>I want to auto set the user password. For example I want to set the password for a no-root user to a value stored somewhere else in the script.</p>
  
  <p>I am doing the following:</p>
  
  <pre><code>echo $input | passwd $user
  </code></pre>
  
  <p>However it fails since there is a prompt for Retype the new password.</p>
  
  <p>I tried:</p>
  
  <pre><code>echo $input | passwd $user
  echo $input | Retype New Password:
  </code></pre>
  
  <p>with no luck. It says password change aborted. How do I accomplish this? Does calling out for retyping a new password invokes another shell process?</p>