On 12/10/17 10:22 PM, Yuri wrote: > On 12/10/17 13:51, Chet Ramey wrote: >> You have not described a bug, since you have not demonstrated that bash is >> behaving other than how it is documented, nor have you provided answers to >> any of the questions you've been asked. You haven't even determined whether >> or not bash is being invoked as a login shell at some unspecified point in >> the mystery login sequence you're using. > > > bash never calls ~/.profile when invoked as a login shell: > > > cp ~/.profile ~/.profile.bak > echo 'echo "==> executing ~/.profile"' > ~/.profile > ln -s /usr/local/bin/bash /usr/local/bin/sh > /usr/local/bin/sh --login > ==> executing ~/.profile > /usr/local/bin/bash --login > > > It only calls ~/.profile when it is named 'sh'.
OK, this is progress. Bash, as documented, reads ~/.bash_profile first when it's invoked as a login shell, falling back to ~/.bash_login and ~/.profile if it's not there. When it's called with the name `sh', it reads ~/.profile. If you tried the same process with ~/.bash_profile, you would see output. This is documented in the INVOCATION section of the man page I referred to in an earlier message. > You should stop depending on sh being linked to bash. It should never > examine its name, and act as a login shell with any name. The use of `sh' to trigger reading ~/.profile is only a concession to historical compatibility -- Posix does not require it. Bash has always preferred ~/.bash_profile when invoked as a login shell. This behavior dates back to the very earliest versions. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/