• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to change shell valluables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to change shell valluables
      • From: Martin Costabel <email@hidden>
References: 
 >How to change shell valluables (From: 和城 光弘 <email@hidden>)
 >Re: How to change shell valluables (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: How to change shell valluables
  • Next by Date: Re: How to change shell valluables
  • Previous by thread: Re: How to change shell valluables
  • Next by thread: Re: How to change shell valluables
  • Index(es):
    • Date
    • Thread