title: Bash script that seems to press unwanted return key
body: <p>I wrote a bash script that first do operations on text files, and then execute another script from within, repeating this operation in a while loop. The script that is executed from within at a certain time ask the user </p>
  
  <p>'press  to stop'</p>
  
  <p>and wait 5 sec, if the user doesn't press return goes further. If I execute this script alone, it works fine, but if I execute it from within the other, it seems that the return key is pressed automatically and stops the execution. </p>
  
  <p>How can I avoid it?</p>
  
  <p>Here is an example of the script:</p>
  
  <pre><code>#!/bin/bash
  
  pMatrixFile='file.csv'
  templateFile='out.txt'
  
  
  
  nSim=0 
  while read line
    do
    ((nSim++))
  
  # ***************Read the input file*****************************************
  
    scale1=$(echo $line | cut -f1 -d\;)
    scale2=$(echo $line | cut -f2 -d\;)
  
  # ***************Write the file to be runned*********************************
  
    sed -e "/double Scale_EX2  = / s|scale_DOE|$scale1|g" \
        -e "/double Scale_EX6  = / s|scale_DOE|$scale2|g" \
        -e "/double Scale_EX7  = / s|scale_DOE|$scale8|g" &lt;$templateFile &gt;$fileName      
  
  # ***************Launch the simulation on server*****************************
    sed -e "s|simFile|$simFile|g" &lt;$submitTemplateFile &gt;$submitFile      
    sed -i "s|simVisName|$simVisName|g"  $submitFile
  
  
  # *************At this line we have the issue!***********
    chmod a+x $submitFile
    . ./$submitFile |tee  log 
  # *******************************************************
  
  # ***************Clean up the temporary files********************************
    rm $simFile $fileName $submitFile
  
    done&lt;$pMatrixFile
  </code></pre>
  
  <p>$submitFile is my external script.</p>
  
  <p>Thanks for the help! </p>