O'Reilly logo

Mac OS X Hacks by Rael Dornfest, Kevin Hemenway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting Shell Environment Variables

An environment variable is a magical piece of invisible data that is acted upon by shell programs and utilities that look for its existence. They’re innocent enough and you rarely interact with them, but they can prove to be quite powerful and time saving when used as part of your daily lifestyle.

Smart developers who care about code integrity use something called a versioning system to ensure a system of checks and balances, easy reversion to previous code, and preventive overwriting (by an automatic or manual merging process). It’s such a common part of a developer’s toolkit that the popular open source web IDE Sourceforge.net provides it as a default service.

One annoyance of Concurrent Versioning System (CVS) (longtime users can find many more) is the command line — without an enviroment variable, you have to type your cvsroot each and every time you make any changes to your repository:

cvs -d:pserver:anonymous@cvs.amphetadesk.sourceforge.net:/cvsroot/amphetadesk login
cvs -z3 -d:pserver:anonymous@cvs.amphetadesk.sourceforge.net:/cvsroot/amphetadesk co AmphetaDesk

These two lines log you into a CVS server as the user anonymous and then check out the entire source tree of a program called AmphetaDesk. A cursory examination shows that the largest part of the command line is the -d flag; it’s also repetitive, as it needs to be a part of every cvs command. It can make a person nuts when she has to worry about committing modifications to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required