LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   'getchar' in shell script (https://www.linuxquestions.org/questions/programming-9/getchar-in-shell-script-144651/)

evilchild 02-10-2004 08:35 PM

'getchar' in shell script?
 
Is it possible to use 'getchar' in a shell script? I'm trying to recieve input from the keyboard, with the script waiting for a user to input something, but instead carrying out a task, and once the user pushs a certain key, it moves to another case specified in a 'case' statment.

I seen some thing similar in a shell script before.

thanks evilchild

slakmagik 02-10-2004 09:52 PM

read

evilchild 02-10-2004 09:55 PM

no, i'm looking for an alternative to the 'read' command, the 'read' command causes the program to wait on the user to input a command, i need some that does require the user to push enter after the input, does any one know if there is some way i could do with through tty?

slakmagik 02-10-2004 09:59 PM

Oops. Sorry. Well, you can timeout the read. read -t <n>. Otherwise, I don't know.


All times are GMT -5. The time now is 10:45 PM.