• 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: bash $PATH variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash $PATH variable


  • Subject: Re: bash $PATH variable
  • From: Markian Hlynka <email@hidden>
  • Date: Fri, 20 Aug 2004 16:31:25 -0600

'.bashrc' is not a BSDism, nor is '.profile'. Read the man page ("man bash") for details about the startup protocol for 'bash' (the same holds for other shells as well; they tend to be fairly well documented, and largely system-independent).

All of your questions are answered in the man page.


I've read the man page before, when I first tried to figure this out. I was adding things to my bashrc file and it wasn't working. It said:


--norc Do not read and execute the personal initialization file
~/.bashrc if the shell is interactive. This option is on by
default if the shell is invoked as sh.



Which wasn't especially helpful. it said the option is on by default. I'm not sure how OS X invokes it, so this is a problem. similarly,


--noprofile
Do not read either the system-wide startup file /etc/profile or
any of the personal initialization files ~/.bash_profile,
~/.bash_login, or ~/.profile. By default, bash reads these
files when it is invoked as a login shell (see INVOCATION
below).



So, is being invoked as a login shell different from being invoked as sh?


looking up invocation is no help either...
A login shell is one whose first character of argument zero is a -, or
one started with the --login option.


what?

and

When bash is invoked as an interactive login shell, or as a non-inter-
active shell with the --login option, it first reads and executes com-
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable. The --noprofile option may be used when the
shell is started to inhibit this behavior.
...
When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists. This
may be inhibited by using the --norc option. The --rcfile file option


so, the precedence is clear except I still don't know what a login shell is! So I still don't understand why .beshrc isn't being called.

nowhere in this file does it tell me what OS X does when I open a new terminal window... or does it? The terminal options say that I can "Execute the default login shell using /usr/bin/login" or I can "specify the complete path". So... that pretty much doesn't help at all.

Why doesn't Apple update the man pages to indicate what OS X does? More appropriately, why doesn't Terminal help say, "put files in .profile if you're using the default login"?

Or, am I being silly? Is it really all there in front of me? I'm willing to be shown that it is, but seriously.. I'm not an idiot... I'm just not at that level of uber-geekdom. I use unix, and I'm comfortable there. I'm comfortable in emacs, or in vi if necessary, and I know how to modify my .cshrc, and .xinitrc, and when to setenv and when to export. But, determining that it was .profile that I had to modify completely eluded me.

Or, to be more exact, I still don't understand why ~/.bashrc isn't used on OSX

Markian
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: bash $PATH variable
      • From: Justin Walker <email@hidden>
References: 
 >bash $PATH variable (From: Professor Leslie Smith <email@hidden>)
 >Re: bash $PATH variable (From: Michael Cashwell <email@hidden>)
 >Re: bash $PATH variable (From: Markian Hlynka <email@hidden>)
 >Re: bash $PATH variable (From: Justin Walker <email@hidden>)

  • Prev by Date: Re: bash $PATH variable
  • Next by Date: Re: How do I set up a subversion server?
  • Previous by thread: Re: bash $PATH variable
  • Next by thread: Re: bash $PATH variable
  • Index(es):
    • Date
    • Thread