O'Reilly logo

Expert Shell Scripting by Ron Peters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required