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


next up previous contents index
Next: .login Up: Environment Previous: .exrc

Subsections



getrc

Query the AIPS++ resource database.

Synopsis

getrc [-i] [-v] keyword

Description

getrc fetches keyword values from the aipsrc (p[*]) databases. The mechanism has some similarities with that of the .Xdefaults database in X-windows. getrc searches a set of aipsrc databases (listed below) in sequence to find a match for the keyword specified on the command line.

Options

-i
Ignore the user's  /.aipsrc file. This is useful to obtain keyword values over which the user is not allowed to have control.

-v
Verbose mode. getrc reports on stderr the name of the file in which it matched the keyword, and also the matching entry. Primarily used for debugging.

Resources

All AIPS++ resources are within the scope of getrc.

Diagnostics

getrc returns 0 on success with the value on stdout. Otherwise, it returns a message on stderr with a non-zero status as follows

Status return values
0: success
1: usage error
2: $AIPSPATH not defined
3: $HOME not defined
4: invalid regular expression
5: pattern not matched

Examples

To get the default printer (Bourne shell):

   PRI=`getrc printer.default 2> /dev/null`

To see where the default printer definition was found:

   grus% getrc -v printer.default
sw_hutt
   Line matched in file /aips++/sun4/epping/grus/aipsrc was
   printer*default:                sw_hutt

Files

The following aipsrc files are consulted in sequence, except that  /.aipsrc is ignored if the -i option is specified.

   ~/.aipsrc
   $AIPSROOT/.aipsrc
   $AIPSHOST/aipsrc
   $AIPSSITE/aipsrc
   $AIPSARCH/aipsrc

It is not an error for any of these files to be absent or empty. Refer to the entry for aipsrc (p[*]) for an explanation of how the aipsrc files are used.

See also

AIPS++ variable names (§1.2).
aipsrc (p[*]), AIPS++ resource database.
affirm (p[*]), get the Boolean value of a set of arguments.

Author

Original: 1992/03/05 by Mark Calabretta, ATNF.


next up previous contents index
Next: .login Up: Environment Previous: .exrc   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