HowTo: Set an Environment Variable in Mac OS X - Terminal Only - Dowd and Associates
HowTo: Set an Environment Variable in Mac OS X - Terminal Only The process of setting environment variables in the Terminal will be familiar to those with experience with Linux or UNIX. It involves editing files in /etc for global environment variables, and in your home directory for user specific environment variables. Login shell vs non-login shell A login shell is the shell that is started when you open a new terminal window. A non-login shell is when you start a sub-shell in the window, for example, typing bash Global PATH only PATH /etc/paths.d with the path you want to add. For example, we will create a file /etc/paths.d/ec2-api-tools /etc/paths.d/ec2-api-tools 1 /opt/aws/ec2-api-tools/bin $PATH Setting environment variables The format for setting an environment variable in the bash shell is KEY=value with no spaces around the equal sign. In addition, when putting it in a configuration file it is necessary to prepend it with export .Read full article from HowTo: Set an Environment Variable in Mac OS X - Terminal Only - Dowd and Associates
No comments:
Post a Comment