[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: hotkey
- From: Jan Carlson <janc iname com>
- To: redhat-list redhat com
- Subject: Re: hotkey
- Date: Wed, 31 Mar 1999 13:24:11 -0500
Josef Lowder wrote:
>
> To: redhat-list redhat com
> Subject: hotkey
>
> I wrote the following note to Red Hat Technical Support
> and got no help, so I hope someone on this list may be more
> willing and able to provide an answer:
>
> j> Does the Red Hat Linux distribution have a utility which allows
> j> "hot-key" key'd input in a shell-script?
> j> For example, if one sets up a shell script to prompt for a response
> j> to start some operation, one might do something like this:
> j> echo -e "Do you want to continue? (y/n) \c"; read ans
> j> In this case, the response requires that one type either: y <ENTER>
> j> or n <ENTER>
> j> But can this be done so that by typing either "y" or "n" will
> j> get an immediate response without having to press <ENTER>?
I don't think there is a way to have bash do that directly.
Just compile a little C program that waits for one of the valid
keypresses, then prints it to stdout, then exits.
Such a program probably exists, and someone might post the source.
There are system calls that let you control that style of reading
from C.
Jan Carlson
janc iname com Scarborough, Ontario, Canada
Netscape4.51 RedHat5.2+updates Linux2.2.4
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]