environment.plist - how to append to a variable?

rhg

Registered
How can I append to a variable in environment.plist?

For example, in profile I can simply specify:

PATH=$PATH:/usr/local/bin

thus, append /usr/local/bin to whatever PATH is already set. Can I do this in environment.plist as well? If yes, how is the syntax?
 
Hi,
There is a nifty little utility to do this: RCEnvironment 1.1 ( http://www.rubicode.com/Software/Bundles.html ). The tool can be launched as a preference pane. It creates environment.plist if it doesn't exist and lets you enter the key/value pairs for environment variables in a dialogue window. Useful, especially if the Developer Tools (with the plist editor) aren't installed.

Jens-Christoph
 
Thank you for your reply. Anyway, that's not what I asked. I already created an environment.plist, first manually, then with the DevTools property list editor.

What I want to know is:

How is the syntax if I want to append something to an existing environment variable?

The bash shell syntax would be:
PATH=$PATH:/usr/local/bin

However, if I put a value like '$PATH:/usr/local/bin' into environment.plist the variable is literally set to this value, i.e. $PATH is not expanded to the contents of the existing value of the PATH variable.
 
As far as I know, you can't expand other variables in the enviroment.plist. So you will have to do your path setting in which ever shell you prefer.
 
Back
Top