[EMAIL PROTECTED] wrote:

> I tried what you said about the hello world echo by adding that
> to .bashrc.  From tests related to that, it seems that even if I ssh
> interactively, only my .profile is getting sourced and not
> my .bashrc.  Presumably non-interactive shells aren't even sourcing
> the .profile, hence the $PATH problems Git is having.
> 
> I got suspicious when echo $0 says "-sh", yet I looked and saw that /
> bin/sh -> bash*.  Maybe ssh is sneakily running sh from somewhere
> despite the bash symlink?  Is there a better way of getting a straight
> answer on what shell is running, and whether it ran .bashrc?

Right, so, as per INVOCATION section of bash(1), when invoked as "-sh"
(i.e. a non-interactive login shell) it attempts to emulate regular old
Bourne shell, and reads only /etc/profile and ~/.profile.  That section
does seem to imply that a non-interactive non-login shell invoked as
"sh" doesn't read any startup files, but the fact that its argv[0]
starts with - should mean that it is in fact login shell, so it should
read your ~/.profile.

Perhaps the simplest workaround would just be to run 'chsh' and change
your shell to /bin/bash explicitly, and then it will read .bashrc.

Brian

Reply via email to