[MacTUG] Bash no bash

Mike Patterson mpatters at cs.uwaterloo.ca
Wed Aug 27 12:46:12 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Turner wrote on 8/27/08 12:34 PM:
> The first terminal session is like a local console; following ones are 
> "terminal session".

The first one isn't being considered an interactive session, so .bashrc
isn't looked at.

I cheat; I have:
executor:~ mpatters$ cat .profile
source ./.bashrc
executor:~ mpatters$

since .profile is looked at whether or not it's a login shell.

You can probably also frob Terminal preferences to have the same effect,
but I'm lazy.

Manpage:
When bash is invoked as an interactive login shell, or as a
non-interactive shell with the --login option, it first reads and
executes commands 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
will force bash to read and execute commands from file instead of ~/.bashrc

Mike

- --
Yes. I started thinking about how hard it might be to fix, but then
I had a fit of sanity and stopped. - Calle Dybedahl, monk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFItYTTrqw9H9F0mCQRAiy+AJ9e5335h0YjKIqwVBFKg3sVFMBnHgCfSW1h
fzfoqmBNIO+jGTxJczhsjC8=
=ov/3
-----END PGP SIGNATURE-----


More information about the MacTUG mailing list