bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I can't get bash-3.2.17 to process startup/login scripts to save me,


From: Bob Proulx
Subject: Re: I can't get bash-3.2.17 to process startup/login scripts to save me, please help!
Date: Wed, 8 Aug 2007 21:33:44 -0600
User-agent: Mutt/1.5.9i

SciFi wrote:
> Got bash-3.2 patchlevel 17 running on MacOSX in place of Apple's:

Is this a self-compiled binary?

> I'm unable to get it to run the (login) startup files at all in any
> way-shape-form.  If the startup file was being executed, the PS1
> prompt should change as a very visible clue (among other things).
> ...
>     0 12422   348   0  31  0    27576    668 -      Ss    p1    0:00.01 login 
> -pf scifi
>   501 12423 12422   0  31  0    30932   1324 -      S     p1    0:00.01 -bash

Seeing "-bash" there looks promising that bash is being started as a
login shell.

> The /etc/bashrc has many things to do, all of which do work (no
> noticable errors when actually sourced manually).  Plus /etc/bashrc
> does set PS1 to another string so we'd instantly know if it'd been
> executed.  I copied /etc/bashrc to /etc/bash.bashrc as an extra
> precaution:
> 
> -bash-3.2$ ls -al /etc/*bash*
> -rwxrwxrwx   1 root  wheel  1739 Aug  4 17:18 /etc/bash.bashrc
> -rwxrwxrwx   1 root  wheel  1739 Aug  4 17:18 /etc/bashrc
> -rw-r--r--   1 root  wheel   329 Jul  3 11:40 /etc/bashrc_orig

But the login files sourced by bash are /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 the
first one that is readable.  The above files that you show are not
read by bash when it is a login shell.

> Any help would be appreciated.  I really need to use bash-3.2 while
> working on the vast other open projects I'm keeping track of. 
> Having to manually source /etc/bashrc each & every time is becoming
> a massive chore, enough that I go back to using Apple's bash-2.05b.

I think there is simply confusion over which files are read by login
shells.  I think if you check you will find that bash invoked as a
login shell will read /etc/profile and ~/.bash_profile okay.  Normally
the ~/.bash_profile will 'source ~/.bashrc' so that it can be shared
between both login shells and non-login shells.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]