Skip to content

How can I get the brew installed path in macOS's non-interactive ssh $PATH variable? #1307

Answered by gromgit
cdayjr asked this question in Everyday usage
Discussion options

You must be logged in to vote

I assume is because it's a non-interactive connection it doesn't run those scripts

I don't use mosh, but I'm quite sure it creates an interactive connection, else it would be pointless. :)

What ssh does when directly invoking a command on the server is to spawn a interactive non-login shell, so ~/.zprofile will never be sourced. Since you're using zsh, the following paragraph from the STARTUP/SHUTDOWN FILES section of the zsh man page is relevant:

Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are read from /etc/zsh/zprofile and then $ZDOTDIR/.zprofile. Then, if the shell is interactive, commands are read from /etc/zsh/zshrc and then $ZDOTDIR/.zshrc

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@cdayjr
Comment options

@corneliusroemer
Comment options

@gromgit
Comment options

@corneliusroemer
Comment options

@gromgit
Comment options

Answer selected by cdayjr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants