Solved

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

Posted on 2004-08-07
5
743 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
ID: 11748759
what has -t to do with your posted example?
0
 
LVL 4

Accepted Solution

by:
alikoank earned 250 total points
ID: 11751315
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
ID: 11754096
> 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

815 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

8 Experts available now in Live!

Get 1:1 Help Now