On 6/2/15 9:08 AM, Wheatley, Martin R wrote:
> $ echo $PATH
> /usr/bin:/usr/sbin:/usr/dt/bin:/home/USER/bin
> $ 
> 
> 
> 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.

This does look like bash is setting the BASH variable, which is the full
pathname, as best as bash can figure, to the current instance of bash.
It's not always $SHELL, for obvious reasons, and not $0.  This question
used to come up a lot.

The puzzling thing is the `-bash'.  Current versions of bash don't add the
`-' at the beginning of the shell name, and I'm not sure older versions
did, either.  You look like you're using Solaris, though, so ancient
versions are definitely possible.

> 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.

You can't mount -o intr?

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to