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

Manipulating Environment Variables

The following sections discuss setting, unsetting, viewing, and modifying environment variables. If you are already using an Informix product, some or all of the appropriate environment variables might already be set.

Setting Environment Variables

Use standard UNIX commands to set environment variables. Depending on the type of shell you use, Figure 3-1 shows how you set the ABCD environment variable to value. The environment variables are case-sensitive.

Figure 3-1
Different Shell Settings

Shell Command

C

setenv ABCD values

Bourne

ABCD=value
export ABCD

Korn

ABCD=value
export ABCD

Korn

export ABCD=value

Korn-shell syntax supports a shortcut, as shown in the last line of Figure 3-1.

The following diagram shows how the syntax for setting an environment variable is represented throughout this chapter. These diagrams indicate the setting for the C shell; for the Bourne or Korn shells, use the syntax shown in Figure 3-1.

For more information on how to read syntax diagrams, see "Command-Line Conventions" in the Introduction.

Viewing Your Current Settings

After one or more Informix products are installed, enter the following command at the system prompt to view your current environment settings.

UNIX Version Command

BSD UNIX

env

UNIX System V

printenv

Unsetting Environment Variables

To unset an environment variable, enter the following command.

Modifying the Setting of an Environment Variable

Sometimes you must add information to an environment variable that is already set. For example, the PATH environment variable is always set in UNIX environments. When you use an Informix product, you must add to the PATH the name of the directory where the executable files for the Informix products are stored.

In the following example, the INFORMIXDIR is /usr/informix. (That is, during installation, the Informix products were installed in the /usr /informix directory.) The executable files are in the bin subdirectory, /usr/informix/bin. To add this directory to the front of the C shell PATH environment variable, use the following command:

Rather than entering an explicit pathname, you can use the value of the INFORMIXDIR environment variable (represented as $INFORMIXDIR), as shown in the following example:

You might prefer to use this version to ensure that your PATH entry does not contradict the path that was set in INFORMIXDIR and so that you do not have to reset PATH whenever you change INFORMIXDIR.

If you set the PATH environment variable on the C shell command line, you might need to include curly braces with the existing INFORMIXDIR and PATH, as shown in the following command:

For more information about setting and modifying environment variables, refer to the manuals for your operating system.




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