bug-bash
[Top][All Lists]
Advanced

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

Re: Bug, feature or just the correct behaviour (stat'ing -bash down the


From: Dave Rutherford
Subject: Re: Bug, feature or just the correct behaviour (stat'ing -bash down the PATH)
Date: Tue, 2 Jun 2015 18:47:06 -0400

On Tue, Jun 2, 2015 at 9:08 AM, Wheatley, Martin R <address@hidden> wrote:
> a truss of "bash -ls" shows it stat'ing '-bash' in each of the directories
> in PATH...
>
> 11933:  stat64("/usr/bin/-bash", 0xFFBFEBE8)            Err#2 ENOENT
> 11933:  stat64("/usr/sbin/-bash", 0xFFBFEBE8)           Err#2 ENOENT
> 11933:  stat64("/usr/dt/bin/-bash", 0xFFBFEBE8)         Err#2 ENOENT
> 11933:  stat64("/home/USER/bin/-bash", 0xFFBFEBE8)      Err#2 ENOENT
>
> Why does bash do all these 'stat()' system calls? We tried providing an
> executable '-bash' at one of the locations but it didn't appear to have
> any effect.

I believe this is bash trying to set the BASH environment variable.
You say creating a file `-bash' has no effect, but how would
stat return ENOENT if there were a file `/usr/bin/-bash'?
If this is on the local machine, it should be searched (and found)
before any NFS directories are checked. What other
consequences this might have I'm not sure. I don't think bash
uses BASH for anything.

Could you send a truss of the case where /usr/bin/-bash
exists and is executable?

> If one of the directories in the PATH is on an NFS server that is
> 'down' then bash hangs - which disables a shell which would otherwise
> be usable.

It is ironic yet somehow appropriate that a fusion energy center
should be having such a 1997 sort of problem today.  But
truly, my sympathies. :-)

Dave

reply via email to

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