Using Sun WorkShop

Using Environment Variables

You can specify environment variables for your build. When you start the build, setenv commands for these environment variables are prepended to the build command.

Using the Environment Variables dialog box, you can add environment variables to or delete them from the Persistent Environment Variables list in your WorkShop target, and reassign values for environment variables in the list.

All macros in the Persistent Environment Variables list are saved with your WorkSet.


Note -

The Persistent Environment Variables list for building your program is not the same as the Persistent Environment Variables list for running your program described in "Setting Environment Variables".


To open the Environment Variables dialog box, click Environment Variables in the Edit Target dialog box.

Adding an Environment Variable

To add an environment variable to the Persistent Environment Variables list::

  1. Type the name of an environment variable in the Name text box.

  2. Type a value for the variable in the Value text box.

    If you make a mistake, click Clear to remove entries in the Name and Value text boxes.

  3. Click Add to add the environment variable to the Persistent Environment Variables list.

  4. Repeat the previous three steps to add other environment variables.

  5. Click OK to close the dialog box.

Deleting an Environment Variable

To delete a variable from the Persistent Environment Variables list:

  1. Select a variable from the list.

  2. Click Delete (Delete All removes all environment variables in the list).

  3. Click OK to establish the change and close the dialog box.

Changing the Value of an Environment Variable

To change the value of an environment variable in the Persistent Environment Variables list:

  1. Select an environment variable in the list.

  2. Type a new value in the Value text box and click Change.

  3. Click OK to establish the change and close the dialog box.

  4. Click Build to start the build with the new build environment.

Reviewing and Overriding Environment Variables

An environment variable definition that appears in the Persistent Environment Variables list overrides any environment variable with the same name that appears in the current WorkShop process environment.

To review the current WorkShop process environment variable definitions, click More to open the Current Environment list, which includes all the environment variables that are currently defined in the WorkShop process environment. You can filter the list using the Filter text box.

To override the value of an environment variable:

  1. Select an environment variable in the Current Environment list.

  2. Click <<Add to add the environment variable to the Persistent Environment Variables list.

  3. Type a new value in the Value text box and click Change.

  4. Click OK to establish the change and close the dialog box.

    The environment variable definition in the Persistent Environment Variables list overrides the environment variable definition in the current WorkShop process environment, and is saved with your WorkSet.

  5. Click Build in the Edit Target dialog box to start the build with the new values.