Peter’s Mac OS X Notes

Contents

Under Mac OS X, environment variables can be configured in three different
places, and each one makes the variables available to different things:

~/.MacOSX/environment.plist - used by everything you launch directly.

~/.cshrc or ~/.tcshrc - used by any tcsh shell you launch (including remotely).

crontab file - you can also set envrionment variables in your crontab.

~/.MacOSX/environment.plist

This file is
read in when you log in as a user under Mac OS X. All the variables
are made available to any application or process you launch, which probably includes
the Terminal and hence any shells you open directly. In particular, this would
include applications like BBEdit and CodeWarrior which runs scripts (like perl and
cvs) on your behalf.

This file is a plist and can be edited with the property editor, or manually,
or it can be created magically from your existing environment via a
script.

Changes take effect at login, so you'll need to logout and log back in.

~/.cshrc or ~/.tcshrc

These files (only ever have one), are used by any tcsh shell you launch,
including remotely accessed ones. Terminal launched ones probably pick up the
environment.plist variables, but if you ssh into your Mac from another Mac,
then probably not.

When you add cron jobs (using conrtab -e), they are neither run under your Mac OS X
login nor under a tcsh shell, so you can also set envrionment variables in your crontab
which will get used when executing cron actions.