SUMMARYThis article explains how to set environment variables for supported versions of Windows, Mac and Linux.
Type "env" in the Taskbar Search,
and select Edit the system environment variables.
Click the Environment Variables... button.
Click New to create a new environment variable
or click Edit to modify an existing environment variable.
Info: Depending on whether you want to set the variable for the current user or all users, use the buttons in User variables or in System variables section, respectively. Setting environment variables for all users requires administrator privileges.
In the Variable name field, enter the name of the environment variable you want to set.
In the Variable value field, enter the value for the variable. The value can be a directory path, for example.
Click OK to have the change take effect.
Close all remaining windows by clicking OK.
NOTE: When editing existing system variables, or adding or deleting either user or system variables, you may need to log off and on again before your changes to environment variables takeeffect.
- Open TextEdit application (Type TextEdit in Spotlight Search Command + Spacebar).
- In TextEdit, use the Make Plain Text command in the Format menu (or Shift + Command + T).
- Copy and Paste the following (or download the attached file):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
launchctl setenv MY_VARIABLE my_value
launchctl setenv TEST_VARIABLE test_value
- Change “MY_VARIABLE” and “MY_VALUE” to your variable and value, respectively. Remove the TEST_VAR line if you don’t need to set multiple environment variables.
NOTE: The label, my.environment, needs to be a unique name from other .plist files
- Open Save dialog in the File menu (Command + S):
- Open Go to the folder with Command + Shift + G,
- Save the file as my.environment.plist. Make sure to confirm use .plist
NOTE: The filename should be the same as the label.
- Restart the computer to apply the environment variables.
Make sure to unselect “Reopen windows when logging back in”.
Alternatively, if you don’t want to restart, and apply the environment variables immediately, run the following command in Terminal app:
launchctl load ~/Library/LaunchAgents/my.environment.plistThen completely close out of the Terminal app.
You can verify by running the following command in Terminal app:
Or you can run the following in the Nuke Script Editor:
The procedure for setting an environment variable depends on the default shell. Open a Terminal window and enter the following to get the name of the shell:
Depending on the output of the previous step, do one of the following:
- If your shell is a csh or tcsh shell, add the following command to the .cshrc or .tcshrc file in your home directory:
setenv VARIABLE value. Replace VARIABLE with the name of the environment variable and value with the value you want to give it, for example
setenv NUKE_PATH /SharedDisk/Nuke.
- If your shell is a bash or ksh shell, add the following command to the .bashrc or .kshrc file in your home directory:
export VARIABLE=value. Replace VARIABLE with the name of the environment variable and value with the value you want to give it, for example
We're sorry to hear thatPlease tell us why