[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Rearrange shell search path
From: |
Eric Blake |
Subject: |
Rearrange shell search path |
Date: |
Tue, 23 Nov 2004 22:07:39 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) |
I encountered a Solaris 8 box at work where the system bash is still at
version 1.x. I wanted a more modern shell, so I promptly changed my $PATH,
built $HOME/bin/bash 3.0, and updated my .bash_profile to use syntax that
only bash 2+ supports. That was fine until I ran configure from one of many
autoconf'd packages, which thanks to _AS_DETECT_BETTER_SHELL, selects the
older /usr/bin/bash and dies when invoking my .bash_profile. (I don't have
a better trace of the actual problems, because I'm typing this at home).
True, the bug is partly my fault, and I cleaned up my .bash_profile to
accomodate the older version of bash, but it caught me by surprise that my
new bash 3.0 wasn't being found in configure scripts.
I think the search for the best shell should favor the user's $PATH over
/bin and /usr/bin, in case the user has a more up-to-date shell
intentionally at the front of their path.
2004-11-23 Eric Blake <address@hidden>
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Favor the user's
path, in case they have a more up-to-date shell than the system.
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.121
diff -u -p -r1.121 m4sh.m4
--- lib/m4sugar/m4sh.m4 14 Nov 2004 06:35:21 -0000 1.121
+++ lib/m4sugar/m4sh.m4 24 Nov 2004 05:10:30 -0000
@@ -219,7 +219,7 @@ if test "x$CONFIG_SHELL" = x; then
_AS_RUN([_AS_DETECT_SUGGESTED_BODY]) 2> /dev/null],
[],
[as_candidate_shells=
- _AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
+ _AS_PATH_WALK([$PATH$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin],
[case $as_dir in
/*)
for as_base in sh bash ksh sh5; do
--
Someday, I might put a cute statement here.
Eric Blake address@hidden
- Rearrange shell search path,
Eric Blake <=