INFORMIX
Informix Guide to SQL: Reference
Chapter 3: Environment Variables
Home Contents Index Master Index New Book

Where to Set Environment Variables

You can set environment variables in the following locations:

Setting Environment Variables at the System Prompt

When you set an environment variable at the system prompt, you must reassign it the next time you log in to the system. For more information about how to do this, see "Manipulating Environment Variables".

Setting Environment Variables in an Environment-Configuration File

The environment-configuration file is a common or private file where you can define all the environment variables that are used by Informix products. Using an environment-configuration file reduces the number of environment variables that you must set at the command line or in a shell file.

The common (shared) environment-configuration file resides in the $INFORMIXDIR/etc/informix.rc file. The permission for this shared file must be set to 644. A user can override the system or common environment variables by setting variables in a private environment-configuration file. The private environment-configuration file must have the following characteristics:

An environment-configuration file can contain comment lines [preceded by the pound (#) sign] and variable lines and their values (separated by blanks and tabs), as shown in the following example:

You can use the ENVIGNORE environment variable to override one or more entries in this file. Use the Informix chkenv utility to perform a sanity check on the contents of an environment-configuration file. The chkenv utility returns an error message if the file contains a bad environment-variable entry or if the file is too large. The chkenv utility is described on page 3-10.

The first time you set an environment variable in a shell file or configuration file, before you work with your Informix product you should source the file (if you are using a C shell) or use a period (.) to execute an environment-configuration file (if you are using a Bourne or Korn shell). This procedure tells the shell process to read your entry.

Setting Environment Variables at Login Time

When you set an environment variable in your .login, .cshrc, or .profile file, it is assigned automatically every time you log in to the system.

Add the commands that set your environment variables to the following login file:

For the C shell

.login or .cshrc

For the Bourne shell or Korn shell

.profile




Informix Guide to SQL: Reference, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.