Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-07
5
Medium Priority
?
756 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 750 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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