?
Solved

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

Posted on 2004-08-07
5
Medium Priority
?
752 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

DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

762 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