May 1, 2010
Report

The waitfor Shell Command

Abstract

Introduction The waitfor command is a command line utility patterned o* of a built-in shell command by the same name that is available under the QNX operating system. Its purpose is to pause until a specied le appears in the le system or a timeout interval is exceeded. waitfor takes either one or two parameters as shown below. waitfor path [timeout] * path | The path/lename of the le being waited on. * timeout { The number of seconds to wait for the le to appear in the le system before giving up and returning an error. This is an optional parameter. If not present, the default value of ve seconds is used. waitfor is intended to be used inside shell scripts to pause script execution until some resource becomes available. This can certainly be a regular le, but quite often waitfor is used to block on some entry in the /dev directory, the presence of which means a device, device driver, or some other capability is now available to be interacted with.

Revised: September 30, 2014 | Published: May 1, 2010

Citation

Hubbard C.W. 2010. The waitfor Shell Command Richland, WA: Pacific Northwest National Laboratory.