Re: How to change shell valluables
Re: How to change shell valluables
- Subject: Re: How to change shell valluables
- From: Justin Walker <email@hidden>
- Date: Tue, 28 Dec 2004 10:10:15 -0800
On Dec 28, 2004, at 9:38, Doug McNutt wrote:
At 16:58 +0900 12/28/04, ??? ?? wrote:
prompt: > set PATH=$PATH:/usr/local/bin
PATH=/bin:/sbin:/usr/bin:/usr/sbin
It sounds like tcsh.
setenv PATH $PATH:/usr/ocal/bin (untested)
You have to export the variable because it is an "environment"
variable. All upper case letters for environment variables is
customary. There is also "path" which is special.
This is not quite correct.
First, 'set' is a built-in command for both csh/tcsh and for sh/bash.
Second, you don't have to use 'export' for an environment variable
*unless* you want the commands that your shell invokes to have access
to that variable. 'set' is used in both shell families (csh & sh) to
set the value of a variable. In 'tcsh', setenv does the job of
"set+export".
You can find details in 'man builtin', as well as the man pages for
each of the shells in the system. Note that each shell has a different
approach to handling environment variables, and also for handling the
"startup scripts", like .login, .profile, etc. The rules for these
files are not entirely straight-forward, so you should read the man
pages for the correct usage.
And watch out for /etc/csh..login which, if executed, may override
your settings. Panther may have made some changes in that area and
it's not so clear just what causes the login to be executed.
The only relevant change (AFAIK) that occurred from 10.2 to 10.3 is a
change in the shell assigned to a new account by default. In 10.2, the
default shell was 'tcsh'. In 10.3, it is 'bash'. In particular,
'bash' ignores '/etc/csh.login'.
$HOME/.MacOSX/environment.plist
is a file and directory you can prepare which can set your PATH in a
truly global way so that it sticks.
AFAIK, this file is not "truly global". No shell that I am aware of
reads this file, and no command-line app knows about it. This file is
used by the Finder, when it invokes a "double-clicked" Aqua app, to set
up an environment in the same way that the shell sets one up for
command-line apps. Also, most (or, at least, many) Aqua apps don't
know about or use environment variables.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | It's not whether you win or
lose...
| It's whether *I* win or lose.
*--------------------------------------*-------------------------------*
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden