DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing Deskshell commands

Status

When a command is executed, it generates a status (a numerical value between 0 and 1023), indicating the results of executing the command. That status is converted to a string and stored in the variable status. When a pipeline is executed, the individual statuses are collected and the strings all stored in the variable status, in the same order as the commands in the pipeline.

A status value of zero is taken to mean ``true'', and a non-zero value to mean ``false''.

The value of status is used implicitly by the following commands:

For example, you can test whether a user pressed Cancel in a gti dialog box as follows:
   file=`(gti 'Enter filename:')
   if -ne $status 0; then exit; fi

See also:


Next topic: How Deskshell commands are executed
Previous topic: Function definitions

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003