Q100127: How to delete/unset environment variables

Follow

SUMMARY

This article explains how to delete environment variables for supported versions of Windows, Mac and Linux.

MORE INFORMATION

To Delete an Environment Variable

ON WINDOWS

  1. Right-click on My Computer and select Properties.
  2. Go to the Advanced system settings tab.
  3. Click the Environment Variables button.
    The Environment Variables dialog opens.
  4. Select the environment variable you want to delete and click Delete.
  5. Repeat step 4 as many times as necessary.
  6. Click OK.

NOTE: When deleting either user or system variables, you may need to log off and on again before your changes to environment variables take effect.

 

ON MAC OSX

NOTE: Recent changes made in OS X El Capitan have broken compatibility with how to set an environment variable on Mac.

If you used the launchd.conf file to set environment variables, see the How to set environment variables article:

  1. Open a Terminal window.
  2. Navigate to the /etc/launchd.conf file, then delete the environment variable(s) and value(s) in the file.
    TIP: Environment variables use either of the following formats: setenv <VARIABLE> <VALUE> or export VARIABLE = value

NOTE: For a list of the environment variables that Nuke understands, see Nuke Environment Variables.

  1. Restart your Mac to apply the changes.

NOTE: Depending on the method you used to create your environment variables and where you’ve stored them, make sure you delete them all. Depending on the shell you used, see the On Linux section for more information on how to delete them.

 

ON LINUX

The procedure for deleting an environment variable depends on what your default shell is.

  1. To get the name of the shell you are using, open a Terminal window and enter echo $SHELL.
  2. Depending on the output of the previous step, do one of the following:
  • If your shell is a csh or tcsh, delete any environment variable(s) and value(s) from the .cshrc or .tcshrc files.
    TIP: Environment variables use the following format: setenv VARIABLE value. For example: setenv NUKE_PATH /SharedDisk/Nuke

OR

  • If your shell is a bash or ksh, delete any environment variable(s) and value(s) from the .bashrc or .kshrc files
    TIP: Environment variables use the following format: export VARIABLE = value. For example: export NUKE_PATH=/SharedDisk/Nuke

NOTE: If you don’t want to delete your environment variables, comment them out to unset them. For example, if you’re using bash, add # in front of the environment variable.

NOTE: If you have set environment variables in any other files, make sure you delete or unset them as well.

 



Keywords:
Environment variables, Nuke, delete, Mac, Windows, SHELL, unset, export, Linux, bash, ksh, csh, tcsh
 
Was this article helpful?
0 out of 0 found this helpful