Skip to content

Comment on Show HN: A fix for the .bash_profile .bashrc .profile madnessparent

Comments

> Do you mean that an interactive shell should load .bash_profile?

No, ssh logs you in, so it is a login shell (and thus calls {bash_,z}profile), but if you call 'ssh ls', it is not an interactive shell since you just ask ssh to launch the 'ls' command remotely.

> Logging into my OS X system with ssh loads .profile

sshd starts login(1) (which shows the 'Last login:' line), which calls your shell as login

Ah, I understand now: The sentence I quoted from the bash man page refers to ssh only when run with a command ("ssh hostname command"). Thanks!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.