I wanted to make zsh load ~/.profile
at login. And I found this zsh-not-hitting-profile
Gilles's answers adding emulate sh -c '. ~/.profile'
in ~/.zprofle
does work.
But I wonder why Frank Terbeck make an addition to it:
[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'
I am not very familiar with linux shell so I don't understand what he says:
And it's only active during the source. So you do not have to save the current option state in order to replay it again after sourcing.
- only active during the source? I need
~/.profile
always need to be source , I can't get the meaning, becauseemulate sh -c 'source ~/.profile
simply works everytime I logined. - save the current option state in order to replay? what is the option state, why I need to replay?