▲ 273 ▼ Which one??? (programming.dev) submitted 2 years ago* by JackbyDev@programming.dev to c/programmer_humor@programming.dev 55 comments fedilink hide all child comments Fuck it, .zshrc it is. Image transcription: Top text: I STILL DON'T KNOW WHAT SHOULD GO IN .*RC VERSUS .*PROFILE Bottom text: AND AT THIS POINT I'M AFRAID TO ASK
[–] communism@lemmy.ml 9 points 2 years ago (3 children) What do the differently coloured arrows mean? I'm confused. permalink fedilink source parent hideshow 3 child comments replies: [–] gamma@programming.dev 11 points 2 years ago* (last edited 2 years ago) (2 children) Select the color which matches the steps before filenames ((non-)login and (non-)interactive), then follow that arrow the rest of the way. There's more colors in Bash because Bash makes a distinction between remote and local shells. Another way to look at the same data for Zsh (note: $ZDOTDIR will be used instead of $HOME if it's defined at any step along the way): File neither interactive login both /etc/zshenv x x x x ${ZDOTDIR:-$HOME}/.zshenv x x x x ${ZDOTDIR:-$HOME}/.zprofile x x ${ZDOTDIR:-$HOME}/.zshrc x x ${ZDOTDIR:-$HOME}/.zlogin x x ${ZDOTDIR:-$HOME}/.zlogout x x One confusion on the Bash side of the diagram is that you see branching paths into ~/.profile, ~/.bash_profile and ~/.bash_login. Bash will use for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and execute only the first one that exists and is readable. permalink fedilink source parent hideshow 2 child comments replies: [–] JackbyDev@programming.dev [S] 3 points 2 years ago (1 child) And what's confusing is that many times those files still manually call the others to make it more logical like zsh. That's what I remember at least, it's been quite a while since I used bash. permalink fedilink source parent hideshow 1 child comment replies: [–] gamma@programming.dev 4 points 2 years ago manually call the others Yeah, most distros will set up source chains to make things nicer for users. permalink fedilink source parent
[–] gamma@programming.dev 11 points 2 years ago* (last edited 2 years ago) (2 children) Select the color which matches the steps before filenames ((non-)login and (non-)interactive), then follow that arrow the rest of the way. There's more colors in Bash because Bash makes a distinction between remote and local shells. Another way to look at the same data for Zsh (note: $ZDOTDIR will be used instead of $HOME if it's defined at any step along the way): File neither interactive login both /etc/zshenv x x x x ${ZDOTDIR:-$HOME}/.zshenv x x x x ${ZDOTDIR:-$HOME}/.zprofile x x ${ZDOTDIR:-$HOME}/.zshrc x x ${ZDOTDIR:-$HOME}/.zlogin x x ${ZDOTDIR:-$HOME}/.zlogout x x One confusion on the Bash side of the diagram is that you see branching paths into ~/.profile, ~/.bash_profile and ~/.bash_login. Bash will use for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and execute only the first one that exists and is readable. permalink fedilink source parent hideshow 2 child comments replies: [–] JackbyDev@programming.dev [S] 3 points 2 years ago (1 child) And what's confusing is that many times those files still manually call the others to make it more logical like zsh. That's what I remember at least, it's been quite a while since I used bash. permalink fedilink source parent hideshow 1 child comment replies: [–] gamma@programming.dev 4 points 2 years ago manually call the others Yeah, most distros will set up source chains to make things nicer for users. permalink fedilink source parent
[–] JackbyDev@programming.dev [S] 3 points 2 years ago (1 child) And what's confusing is that many times those files still manually call the others to make it more logical like zsh. That's what I remember at least, it's been quite a while since I used bash. permalink fedilink source parent hideshow 1 child comment replies: [–] gamma@programming.dev 4 points 2 years ago manually call the others Yeah, most distros will set up source chains to make things nicer for users. permalink fedilink source parent
[–] gamma@programming.dev 4 points 2 years ago manually call the others Yeah, most distros will set up source chains to make things nicer for users. permalink fedilink source parent