[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I can't get bash-3.2.17 to process startup/login scripts to save me, ple
From: |
SciFi |
Subject: |
I can't get bash-3.2.17 to process startup/login scripts to save me, please help! |
Date: |
Sun, 5 Aug 2007 00:07:47 +0000 (UTC) |
User-agent: |
Pan/0.131 (Ghosts: First Variation; SVNr310; i386-apple-darwin8.10.1) |
Hi,
Got bash-3.2 patchlevel 17 running on MacOSX in place of Apple's:
-bash-3.2$ which bash
/bin/bash
-bash-3.2$ file /bin/bash
/bin/bash: symbolic link to `/usr/bin/bash'
-bash-3.2$ file /usr/bin/bash
/usr/bin/bash: Mach-O executable i386
-bash-3.2$ ls -al /usr/bin/bash
-rwxr-xr-x 1 root wheel 480968 Aug 4 18:31 /usr/bin/bash
Note the PS1 prompt shown -- 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).
Apple's Terminal login is doing the right thing AFAICT:
-bash-3.2$ ps -axl
[...]
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
[...]
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
In case this new version of bash finds one of the startup files in
$HOME instead to run, I coded all of these to do exactly the same
thing as .bashrc:
-bash-3.2$ cat .bashrc
. /etc/bashrc
-bash-3.2$ ls -al
total 224
[...]
-rwxrwxrwx 1 scifi scifi 14 Aug 4 16:36 .bash_login
-rwxrwxrwx 1 scifi scifi 14 Aug 4 16:36 .bash_profile
-rwxrwxrwx 1 scifi scifi 14 Aug 4 16:36 .bashrc
[...]
-rwxrwxrwx 1 scifi scifi 14 Aug 4 16:36 .login
[...]
-rwxrwxrwx 1 scifi scifi 14 Aug 4 16:36 .profile
[...]
-bash-3.2$ _
Even bash -l doesn't cause any of these startup files to run:
-bash-3.2$ bash -l
bash-3.2$ exit
logout
-bash-3.2$ _
(note the leading '-' went away)
If I manually source my /etc/bashrc it'll work:
-bash-3.2$ . /etc/bashrc
scifi[~]
scifi$ _
(note the new two-line prompt ... it's actually reverse-video'd
which I can't show you quite properly here ;) )
I recompiled bash-3.2.17 with these config-top.h #defines enabled
(also showing you my new two-line prompts):
scifi[~/Projects/bash-3.2]
scifi$ diff -ubBw config-top.h_orig config-top.h
--- config-top.h_orig 2005-04-29 15:36:34 -0500
+++ config-top.h 2007-08-04 18:29:23 -0500
@@ -80,8 +80,8 @@
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
run the startup files when not in posix mode. */
-/* #define NON_INTERACTIVE_LOGIN_SHELLS */
+#define NON_INTERACTIVE_LOGIN_SHELLS
/* Define this if you want bash to try to check whether it's being run by
sshd and source the .bashrc if so (like the rshd behavior). */
-/* #define SSH_SOURCE_BASHRC */
+#define SSH_SOURCE_BASHRC
scifi[~/Projects/bash-3.2]
scifi$ _
Nothing changes with these two #defines enabled, compiled, and
installed (and 'activated' with Apple's system).
One more little test. With the new string for PS1, then invoking
'bash' again, we go back to the old string until it is exited:
scifi[~/Projects/bash-3.2]
scifi$ bash
bash-3.2$ exit
exit
scifi[~/Projects/bash-3.2]
scifi$ _
...but the env-vars _do_ get properly inherited during that run.
So I'm totally confused. I had bash-3.2 working on a G4/G5 at an
older patchlevel, but I can't figure out which patchlevel that was
(those machines are untouchable ATM). I do feel certain some new
recent patch has caused breakage of this, tho, but I wonder why no
one else has reported this.
I ran these ./configure options before make'ing:
>>>>
#
./configure \
--prefix=/usr \
--enable-alias \
--enable-arith-for-command \
--enable-array-variables \
--enable-bang-history \
--enable-brace-expansion \
--enable-command-timing \
--enable-cond-command \
--enable-cond-regexp \
--enable-debugger \
--enable-directory-stack \
--enable-disabled-builtins \
--enable-dparen-arithmetic \
--enable-extended-glob \
--enable-help-builtin \
--enable-history \
--enable-job-control \
--enable-multibyte \
--enable-net-redirections \
--enable-process-substitution \
--enable-progcomp \
--enable-prompt-string-decoding \
--enable-readline \
--enable-restricted \
--enable-select \
--enable-separate-helpfiles \
--enable-strict-posix-default \
--enable-xpg-echo-default \
--enable-mem-scramble \
--with-curses \
--with-installed-readline \
--with-libiconv-prefix=/usr \
--with-libintl-prefix=/usr \
#
<<<<
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.
Thank you.
- I can't get bash-3.2.17 to process startup/login scripts to save me, please help!,
SciFi <=