Setting and Using Environment Variables
 
 
 

This section describes how to set, unset, use, and echo environment variables. The procedures are different on Windows as compared to Linux.

On Windows

You can define environment variables on Windows using the set command as described in the sections that follow.

To permanently change environment variables on Windows

When you modify the setenv.bat file, the modifications are used each time you launch the interactive Softimage application, the command-line Softimage application, or the mental ray renderer.

  • Use the User Tools utility or a text editor to modify the setenv.bat file in the Application\bin subfolder of the directory where Softimage is installed.

    • For information about the syntax of the set command, see the sections that follow.

    • For information about specific variables, see Table of Environment Variables.

      NoteYou can also set environment variables for a user profile using Control Panel. These changes will affect the environment for all applications run by that user. See your Windows documentation for more information.

To temporarily change environment variables on Windows

When you modify environment variables in a command prompt window, the modifications affect that specific window and any programs launched from it.

  1. Open a command prompt window.

    For example, to open a command prompt with the default Softimage environment already set, choose Programs Autodesk Softimage 2012.SAP Command Prompt from the Windows Start menu.

  2. Modify the environment variables as needed.

    • For information about the syntax of the set command, see the sections that follow.

    • For information about specific variables, see Table of Environment Variables.

      TipIf you often need to make the same modifications, store your commands in a batch file and run it.
  3. Start an application in the modified environment.

    For example to launch the interactive Softimage program from the command prompt, enter the following:

    xsi

Setting Environment Variables on Windows

To create or modify an environment variable, use the set command. For example, to set the variable SI_LINKTAB_LOCATION to the value C:\LinktabFolder:

set SI_LINKTAB_LOCATION=C:\LinktabFolder

Do not enclose the value in quotes, unless you want the quotes to be part of the value. Note that variable names are not case-sensitive on Windows.

Unsetting Environment Variables on Windows

To unset an environment variable, set it to nothing. For example:

set MYTEMPVAR=

Using Environment Variables on Windows

To use the current value of an environment variable in a command, enclose the variable name in percentage signs (%). For example, to add the directory C:\MyDir to the beginning of the search path:

set PATH=C:\MyDir;%PATH%

Echoing Environment Variables on Windows

To echo the current value of an environment variable to the command prompt window, you can use the echo command and enclose the variable name in percentage signs. For example, to see the current search path:

echo %PATH%

Alternatively, you can use the set command without using the equal sign (=). For example:

set PATH

Instead of specifying the full variable name, you can use the set command with the initial characters of the name to echo all variables that begin with that string.

To see the current values of all environment variables, enter the following:

set

On Linux

You can define environment variables on Linux using setenv and unsetenv as described in the sections that follow.

To permanently change environment variables on Linux

You can change environment variables permanently in the .xsi_2012.SAP file. Make sure that this file is sourced before launching the interactive Softimage application, the command-line Softimage application, or the mental ray renderer. The .xsi_2012.SAP file is located where the Softimage program files are installed (by default /usr/Softimage/Softimage_2012.SAP), but if there is a version in your home directory it will take precedence.

  • Use the User Tools utility or a text editor to modify the .xsi_2012.SAP file.

    • For information about the syntax of the setenv and unsetenv commands, see the sections that follow.

    • For information about specific variables, see Table of Environment Variables.

      NoteYou can also set environment variables in a user's .cshrc file. These changes affect the environment for all applications run by that user.

To temporarily change environment variables on Linux

When you modify environment variables in an xterm or shell window, the modifications affect that specific window and any programs launched from it.

  1. Open an xterm or shell window.

  2. If desired, set the default Softimage environment. For example,

    source /usr/Softimage/Softimage_2012.SAP/.xsi_2012.SAP
    NoteThe .xsi_2012.SAP script uses the C shell syntax. If you are using a different command interpreter as your default, see Running the Environment Script on Linux.
  3. Modify the environment variables as needed.

    • For information about the syntax of the setenv and unsetenv commands, see the sections that follow.

    • For information about specific variables, see Table of Environment Variables.

      TipIf you often need to make the same modifications, store your commands in a shell script and source it.
  4. Start an application in the modified environment. For example to launch the interactive Softimage program, enter the following:

    xsi

Setting Environment Variables on Linux

To create or modify an environment variable, use the setenv command. For example, to set the variable SI_LOCATION to the value usr/Softimage/SOFT3D_4.0:

setenv SI_LOCATION "/usr/Softimage/SOFT3D_4.0"

Character strings must be enclosed in double quotes. Remember that variable names are case-sensitive on Linux.

Unsetting Environment Variables on Linux

To unset an environment variable, use the unsetenv command. For example:

unsetenv MYTEMPVAR

Using Environment Variables on Linux

To use the current value of an environment variable in a command, prefix the variable name with a dollar sign ($). For example, to add the directory ~/MyDir to the beginning of the search path:

setenv PATH "~/MyDir:$PATH"

Echoing Environment Variables on Linux

To echo the current value of an environment variable to the shell or xterm window, use the echo command and prefix the variable name with a dollar sign ($). For example, to see the current search path:

echo $PATH

To echo all environment variables, use:

env

Running the Environment Script on Linux

The .xsi_2012.SAP environment script uses the C shell syntax. The C shell is a common command interpreter on Linux.

If you are using a different command interpreter as your default, you can switch to a C shell temporarily to run the environment script. You can also change your default command interpreter permanently.

To run the C shell temporarily on Linux

Start a C shell in the current shell or xterm window by doing either one of the following:

  • To start a standard C shell, run:

    csh
  • To start a Tab C shell, run:

    tcsh

To set the C shell as default on Linux

  1. Log in as root.

  2. Run the /sbin/linuxconf configuration utility.

  3. Go to User Accounts Normal User Accounts. From here you can choose among the various users and adjust different parameters.

  4. Change the command interpreter to either csh or tcsh.