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


next up previous contents index
Next: aipshosts Up: Environment Previous: Environment

Subsections



aipsinit

AIPS++ initialization procedure.

Synopsis

. aipsinit.sh ...for Bourne-like shells, e.g. sh, bash, ksh
source aipsinit.csh ...for C-like shells, e.g. csh, tcsh
. aipsinit.rc ...for the rc shell
. aipsinit.es ...for the es shell

Description

The aipsinit scripts define the $AIPSPATH environment variable required by AIPS++, and modify the PATH environment variable (and MANPATH if defined) to include the relevant AIPS++ bin (and man) directories. They are normally invoked at login by the .profile or .login files.

The $AIPSPATH environment variable consists of a sequence of four character strings separated by spaces containing the following information:

1.
Root of the AIPS++ directory tree.

2.
Host ``architecture''.

3.
Local site name.

4.
Host name.

aipsinit modifies the PATH environment variable to include the AIPS++ binary directories as follows:

1.
Firstly, any prior AIPS++ path definition is either removed, or if $AIPSPATH was already defined, translated back into an aips_bin keyword.

2.
If the keyword aips_bin is encoded into PATH it is replaced with the fully qualified pathname.

3.
If the aips_bin keyword is not present, the AIPS++ bin directory is added to the start of PATH, following ``.'' if it came first.

The keyword mechanism allows full control over placement of the AIPS++ bin directories in PATH and is the recommended method.

If $AIPSPATH is already defined when aipsinit is invoked it will also check for any AIPS++ programmer directories in the PATH, for example any referring to programmer bin directories, and if so will attempt to amend them. This works only if the programmer workspace is rooted at a directory named aips++.

If the MANPATH environment variable is defined, aipsinit modifies it in the same manner as for PATH except using the aips_doc keyword. If the aips_doc keyword is not present, the AIPS++ man area is always added to the start of MANPATH.

The host ``architecture'', a string of the form <base>[_<ext>], corresponds to a subdirectory of the AIPS++ root directory in which an AIPS++ system resides (object libraries, executables,...). The base part of the name is a mnemonic predefined by AIPS++ which describes the binary format of a machine and reflects the combination of machine architecture and operating system. The optional extension is used to select between alternative systems of the same binary format, for example as may have been generated by different compilers.

aipsinit recognizes an environment variable (or shell variable in aipsinit.csh) aips_ext which, if defined, overrides the architecture extension defined in the aipshosts (p[*]) file for a particular machine. By convention, setting aips_ext to ``_'' signals no extension, that is, any architecture extension specified in aipshosts is stripped off. For certain shells (bash, csh, es, ksh, rc, and tcsh) aipsinit also defines an alias or shell function also called aipsinit which takes a value for aips_ext as an argument and reinvokes aipsinit. This provides a convenient mechanism for interactively switching between architecture extensions. Note that aipsinit always undefines aips_ext.

Options

The aipsinit scripts take no options directly (such scripts cannot take arguments). However, see the description of the aips_bin and aips_doc keywords above, and also the aips_ext environment (or shell) variable.

Resources

The information for setting the architecture and site name is contained in the aipshosts (p[*]) file. If this does not contain an entry for a particular machine, aipsinit tries to deduce it.

Examples

For Bourne-like shells the following sequence might be used in .profile:

   PATH=".:$HOME/bin:aips_bin:/usr/local/bin:/usr/ucb:/usr/bin:/bin"
   MANPATH=".:$HOME/man:aips_doc:/usr/local/man:/usr/man"
   [ -f /aips++/aipsinit.sh ] && . /aips++/aipsinit.sh

For C-like shells the following sequence might be used in .login:

   setenv PATH ".:~/bin:aips_bin:/usr/local/bin:/usr/ucb:/usr/bin:/bin"
   setenv MANPATH ".:~/man:aips_doc:/usr/local/man:/usr/man"
   if (-f /aips++/aipsinit.csh) source /aips++/aipsinit.csh

or alternatively

   set path = (. ~/bin aips_bin /usr/local/bin /usr/ucb /usr/bin /bin)
   if (-f /aips++/aipsinit.csh) source /aips++/aipsinit.csh

For the rc shell the following sequence might be used in .rcrc:

   PATH=.:$HOME/bin:aips_bin:/usr/local/bin:/usr/ucb:/usr/bin:/bin
   MANPATH=.:$HOME/man:aips_doc:/usr/local/man:/usr/man
   if (test -f /aips++/aipsinit.rc) . /aips++/aipsinit.rc

For the es ``extensible'' shell the following sequence might be used in .esrc:

   PATH=.:$HOME/bin:aips_bin:/usr/local/bin:/usr/ucb:/usr/bin:/bin
   MANPATH=.:$HOME/man:aips_doc:/usr/local/man:/usr/man
   if {test -f /aips++/aipsinit.es} {. /aips++/aipsinit.es}

Files

$AIPSROOT/aipshosts
...database of AIPS++ hosts.

$AIPSROOT/.login
...aips2mgr's .login file.

$AIPSROOT/.profile
...aips2mgr's .profile file.

The .login (p[*]) and .profile (p[*]) files are provided for aips2mgr's interactive and cron jobs.

See also

aipshosts (p[*]), AIPS++ hosts database.
.login (p[*]), aips2mgr's .login file.
.profile (p[*]), aips2mgr's .profile file.

Author

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


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