Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: amkdir Up: General Previous: adate

Subsections



affirm

Determine the Boolean value of a set of arguments.

Synopsis

affirm [-a | -o] [-s] [string1 [string2...]]

Description

affirm tests its arguments for truth or falsehood. The arguments can be of the form true/false, t/f, yes/no, y/n, on/off, 1/0 and are case insensitive. It will print either true or false on stdout with a status return to match.

Options

-a
Produce the logical AND of all arguments (default).

-o
Produce the logical OR of all arguments.

-s
Work silently, just producing the exit status.

Notes

Diagnostics

Status return values reflect a true or false result, or invokation error
0: true
1: false
2: unrecognized argument

Examples

To test an aipsrc (p[*]) resource setting (Bourne shell):

   ENABLED=`affirm -a \`getrc inhale.base.code.preserve 2> /dev/null\``

Sets ENABLED to true if the inhale.base.code.preserve was set to some variant of the affirmative, or if it was not defined. To get a false value by default the -o option could have been used instead.

See also

aipsrc (p[*]), AIPS++ resource database.
getrc (p[*]), query AIPS++ resource database.

Author

Original: 1993/09/01 by Mark Calabretta, ATNF


next up previous contents index
Next: amkdir Up: General Previous: adate   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15