LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   User input problem in a ksh script (https://www.linuxquestions.org/questions/programming-9/user-input-problem-in-a-ksh-script-503244/)

elmu 11-20-2006 06:57 AM

User input problem in a ksh script
 
Hello,

I have a code below where I want to get a user input. It seems to be trivial, but as there is a loop with read -r so the inside read doesn't work properly. It means that the function doesn't wait for an enter.

Any idea how can I solve this?

Code:

while read -r line
do
  read userInput
  echo $userInput
done < $MYFILE


jlliagre 11-20-2006 07:24 AM

Try:
Code:

read userInput < /dev/tty


All times are GMT -5. The time now is 03:49 PM.