Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • Probably /bin/sh does not source .bash_aliases, but the exported function is passed to sh, see unix.stackexchange.com/q/157547/330217 Commented Jun 14, 2019 at 15:58
  • @Bodo I don't see the relevance. sh is sourcing .bash_aliases because the OP is logging into a remote machine, so starting a login shell. Login shells read .profile and the OP's .profile is set to source .bashrc which, in turn, sources .bash_aliases :) Commented Jun 14, 2019 at 16:01
  • @Bodo see updated answer, I explained it a bit more. Commented Jun 14, 2019 at 16:05
  • The OP wrote explicitly about "exported functions". I may have overlooked it, but where did you find the information that .profile sources .bashrc? Commented Jun 14, 2019 at 16:06
  • @Bodo yeah, I am sort of assuming that the functions aren't actually exported since the question doesn't show any export -f. I took that to be a misunderstanding of the OP's. The rest I got because we know the OP is running a login shell and yet stuff defined in bashrc is being called and from this comment. Commented Jun 14, 2019 at 16:07