title: How do I pass arguments to a bash script using a pipe?
body: <p>I want to pass an argument to a read command within this script via a pipe or some other method.</p>
  
  <p>My command within the script is</p>
  
  <pre><code>read -p "Change Parameters?
  while [ $REPLY != "n" ]
  do
          if  [ $REPLY == "a" ]
          then
  ..
  ..
          if [ $REPLY =="j" ]
  ..
  done
  </code></pre>
  
  <p>The read command appears on line 48 of my script if thats of any use</p>
  
  <p>I've tried</p>
  
  <pre><code>./script argument1 argument2 | bash /dev/stdin "n"
  </code></pre>
  
  <p>which results in </p>
  
  <pre><code>Change Parameters? /dev/stdin: line 1: Default: command not found
  /dev/stdin: line 2: a: command not found
  /dev/stdin: line 3: b: command not found
  /dev/stdin: line 4: c: command not found
  /dev/stdin: line 5: d: command not found
  /dev/stdin: line 6: e: command not found
  /dev/stdin: line 7: f: command not found
  /dev/stdin: line 8: g: command not found
  /dev/stdin: line 9: h: command not found
  /dev/stdin: line 10: i: command not found
  /dev/stdin: line 11: j: command not found
  /dev/stdin: line 12: n: command not found
  </code></pre>
  
  <p>And then stops</p>
  
  <p>I just want to pass the letter n to this command and for the script to continue till the end.</p>