Environmental Variable and Mountain Lion

/, Coding/Environmental Variable and Mountain Lion

Environmental Variable and Mountain Lion

I updated to Mountain Lion not long ago and have been running most music programs and IDEs without problem. But I noticed issues mainly regarding Environmental Variables I set for network identifications.

So here’s a way to set Environmental Variables for Mountain Lion.
I had been using the RCEnvironment from Rubicode, but this method is fairly painless. Below are also ways to test and implement your machine name in MaxMSP and ChucK.

The following steps are for Max OS 10.8 ‘Mountain Lion’.

Setting Computer Name

  1. Go to System Preferences and click on the Sharing icon. (System Preferences > Sharing)
  2. Type your Computer Name making sure it is one word, with no capital letters.

Below is an example of the Sharing window with a Computer Name set to ‘w00t’.

Setting Environmental Variable NET_NAME

  1. Open a Terminal window
  2. Use the command ‘sudo nano /etc/launchd.conf’.
  3. Enter your password.
  4. Type the following command with the Computer Name you used above and WITHOUT THE BRACKETS:

setenv NET_NAME

[ComputerName]

  1. Press ‘Ctrl + o’ to save the file.
  2. Press enter to accept the name (no name change should be necessary).
  3. Press ‘Ctrl + x’ to exit the editor.
  4. Reboot the computer.

To check the the NET_NAME after you’ve rebooted:
1. Open a new Terminal Window.
2. Typing the following command and hit enter:

printenv NET_NAME

Look for the following information printed in the Terminal Window.


To check your Environmental Variable NET_NAME in MaxMSP:

To check your Environmental Variable NET_NAME in ChucK:

<<<Std.getenv(“NET_NAME”)>>>;

By | 2016-11-01T22:30:13+00:00 August 21st, 2012|blog, Coding|0 Comments

About the Author:

%d bloggers like this: