[1.5.25-15] bash won't load .bashrc after i rename it as `sh.exe'.
Dave Korn
dave.korn.cygwin@googlemail.com
Sat Jul 11 20:46:00 GMT 2009
chengxianle wrote:
> bash.exe loads my .bashrc in $HOME directory.
> But when i copy bash.exe as sh.exe, .bashrc won't be loaded.
> Rename as anything(like sh1.exe, sh2.exe, ...) except `sh.exe' works fine!
By design. Invoking bash as 'sh' enters special sh-compatibility mode.
See "info bash", section 6.2 Bash Startup Files:
> Invoked with name `sh'
> ......................
>
> If Bash is invoked with the name `sh', it tries to mimic the startup
> behavior of historical versions of `sh' as closely as possible, while
> conforming to the POSIX standard as well.
>
> When invoked as an interactive login shell, or as a non-interactive
> shell with the `--login' option, it first attempts to read and execute
> commands from `/etc/profile' and `~/.profile', in that order. The
> `--noprofile' option may be used to inhibit this behavior. When
> invoked as an interactive shell with the name `sh', Bash looks for the
> variable `ENV', expands its value if it is defined, and uses the
> expanded value as the name of a file to read and execute. Since a
> shell invoked as `sh' does not attempt to read and execute commands
> from any other startup files, the `--rcfile' option has no effect. A
> non-interactive shell invoked with the name `sh' does not attempt to
> read any other startup files.
>
> When invoked as `sh', Bash enters POSIX mode after the startup files
> are read.
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list