[X-Unix] .profile v/s .bashrc

Doug McNutt douglist at macnauchtan.com
Wed Oct 13 21:22:45 PDT 2004


At 18:03 -0400 10/13/04, Alexandre Quessy wrote:
>When I first log in, it's my « .profile » that is executed. If i change my shell to zsh, for instance, and then I switch back to bash, it's my « .bashrc » that is executed


Login to OS neXt is NOT a UNIX login. I really wish that it was but. . .

For a limited selection of environment items it's possible to get some help by establishing a file called environment.plist in your home folder under directory .MacOS (note the leading dot.)

There is an app note on it from Apple and I suspect a search will find it. environment.plist is an XML file in which you can specify key/value pairs that will be recognized by any application, Terminal included. I don't think there is any way to handle shell aliases though. You cannot execute a shell command in environment.plist so you can't, for instance, add an item to the default $PATH variable. environment.plist is read at login-to-OSneXt time. Forget about modifying it and expecting it to be re-read when you open Terminal.

By the way, your problem is magnified when you attempt to execute shell commands from things like an AppleScript or a BBEdit worksheet. Neither behaves like a login shell and AppleScript will use sh, ignoring your chosen default shell and any *rc file you have.

There is a subtlety in that sh and bash are really the same file with different names. csh and tcsh are similar. They could be hard links to the same disk space but in Panther they are actually copies. I'm still scratching my head about that.


-- 

-->  Halloween  == Oct 31 == Dec 25 == Christmas  <--


More information about the X-Unix mailing list