title: Echoing to a command after a delay in Bash
body: <p>I want to copy a .bin file in a .img file using mcopy. For this, I can use <code>mcopy -i image.img bin.bin ::</code>. When using this, it will tell me: <code>Long file name "bin.bin" already exists.
  a)utorename A)utorename-all r)ename R)ename-all o)verwrite O)verwrite-all
  s)kip S)kip-all q)uit (aArRoOsSq):</code>. Due to the size and importance of stable files in this project, I just always want to put in <code>O</code> (small size and no importance, just so you know).</p>
  
  <p>So I searched, and found this could be done by using the command: <code>echo "O" | mcopy -i image.img bin.bin ::</code>. Great. However, mcopy has a slight delay, due to which the echo does NOT enter <code>O</code> on the right time (too soon). I tried to use <code>{ sleep 2; echo "O"; } | mcopy -i image.img bin.bin ::</code>, which helps nothing either.</p>
  
  <p>So: How to actually <code>echo</code> text to a command after a delay, using <code>bash</code>?</p>
  
  <p>(For the comments: adding -n to the <code>mcopy</code> command does neither work)</p>
  
  <p>EDIT: There seemed to be some confusion about the purpose of the question, so I will try to clarify it. Point is, I have a problem and I want it solved. This could be done by using <code>mcopy</code> in an alternative way, as proposed in the comments already, OR by delaying the <code>echo</code> to the command (as is the question).
  Even if my problem is solved in a way where the <code>mcopy</code> command is altered, that still would not answer the question. So please keep that in mind.</p>