LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-20-2006, 06:57 AM   #1
elmu
LQ Newbie
 
Registered: Feb 2005
Posts: 17

Rep: Reputation: 0
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
 
Old 11-20-2006, 07:24 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Try:
Code:
read userInput < /dev/tty
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script user input tuckermaddox Linux - Newbie 5 08-12-2004 03:14 AM
Masking user input in sh script? RMSe17 Linux - Software 3 07-20-2004 10:17 PM
mask user input in a bash script PlatinumRik Linux - Software 1 06-15-2004 10:06 AM
ksh script problem pldobs Programming 2 12-24-2003 11:38 PM
User input using a BASH script... causticmtl Programming 5 07-13-2003 09:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration