Cover by Ron Peters

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 18User Input Timeout

Sometimes you want a program that accepts user input to run automatically. If the user does not type anything within a specified amount of time, the program should continue running and use a default value for input.

A boot loader is a good example of this type of application. It would give the user a prompt where they will be able to choose the OS or kernel to be booted, but if the user lets the timeout expire, the boot loader uses a previously defined default operating system to boot the system.

An automated system-build script is another example. I wrote one to perform an automated system build while running from a bootable CD. This script would allow the user to choose how to build the system. If there were no ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required