Solved

Linux shell scripts: user input with 'read', but with a timeout

Posted on 2004-08-07
5
738 Views
Last Modified: 2010-04-21
Hi,

Normally, in a shell script I get input from the user by using the command:

read yesno
if [ "$yesno" == "y" ]
then
  echo Ok.
fi

However, the distribution of Linux I am using (ARM based) doesnt support for a with the 'read' command. You just can't use -t N.

Could you explain how to read a response from the user, into a variable, with a timeout. The the program has to run on ARM based linux, so it could be source code, or a utility that I can compile for Linux.
0
Comment
Question by:Risky101
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
what has -t to do with your posted example?
0
 
LVL 4

Accepted Solution

by:
alikoank earned 250 total points
Comment Utility
read is a builtin command of shell.

You can always use a different shell or download the latest version of bash for your platform.
0
 

Author Comment

by:Risky101
Comment Utility
> what has -t to do with your posted example?

made a typo in the question - it should say "However, the distribution of Linux I am using (ARM based) doesnt support timeouts with the 'read' command. You just can't use -t 5 to timeout in 5 seconds."
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now