bug-bash
[Top][All Lists]
Advanced

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

Re: PATH strange behaviour


From: Sven Wegener
Subject: Re: PATH strange behaviour
Date: Fri, 3 Aug 2007 19:58:28 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Fri, Aug 03, 2007 at 04:32:10PM +0200, J?r?my Herv? wrote:
> - version : 3.1.17(2)-release (i486-slackware-linux-gnu)
> - description : Strange behaviour ; second time I have it. I removed
> an old apache package (1.3, /usr/sbin/httpd) and make;make-installed a
> new one (/usr/bin/httpd). Here is the transcript of what appened then.
> 
> root@crystal:/usr/bin# env | grep PATH
> MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man:/usr/lib/java/man:/usr/share/texmf/man
> PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/share/texmf/bin
> PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/kde/lib/pkgconfig
> root@crystal:/usr/bin# ls -l httpd
> -rwxr-xr-x 1 root root 643348 2007-08-03 15:49 httpd*
> root@crystal:/usr/bin# ls -l /usr/sbin/httpd
> /bin/ls: /usr/sbin/httpd: No such file or directory
> root@crystal:/usr/bin# whereis httpd
> httpd: /usr/bin/httpd /usr/include/httpd.h /usr/man/man8/httpd.8
> /usr/share/man/man8/httpd.8
> root@crystal:/usr/bin# httpd -v
> -bash: /usr/sbin/httpd: No such file or directory
> root@crystal:/usr/bin# ./httpd -v
> Server version: Apache/2.2.4 (Unix)
> Server built:   Aug  3 2007 15:46:58
> root@crystal:/usr/bin# sh
> root@crystal:/usr/bin# httpd -v
> Server version: Apache/2.2.4 (Unix)
> Server built:   Aug  3 2007 15:46:58
> root@crystal:/usr/bin# ls -l /usr/sbin/httpd
> ls: /usr/sbin/httpd: No such file or directory
> root@crystal:/usr/bin# env | grep SHELL
> SHELL=/bin/bash
> root@crystal:/usr/bin# /bin/bash --version
> GNU bash, version 3.1.17(2)-release (i486-slackware-linux-gnu)
> Copyright (C) 2005 Free Software Foundation, Inc.
> root@crystal:/usr/bin#

Well, that's expected behaviour. bash remembers the full path name for
commands executed. In this case it has remembered the location
/usr/sbin/httpd for the httpd command. You're update has removed it, but
bash doesn't know it's gone. The new shell you executed starts with an
empty hash. You can use hash -r to force bash to forget it.

Sven

-- 
Sven Wegener
Gentoo Developer
http://www.gentoo.org/




reply via email to

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