Why my $SHELL is bash, but .zshrc works instead of .bashrc .bash_profile?

Kernel: 5.15.41-1-MANJARO
DE: Plasma 5.24.5

I haven’t changed my shell, all the things related to shell are kept as the default when installed.

When I try to add something to .zshrc, it worked, but my “echo $SHELL” is bash. Why? And what’s the real dot profile load order?

Similar threads:

1 Like

Thanks, I’ll take a closer look at these contents.

I found this thread also useful:

Add this line to .zshrc:

[[ -e ~/.bash_profile ]] && emulate sh -c ‘source ~/.bash_profile’

And in the .bash_profile:

[[ -f ~/.bashrc ]] && . ~/.bashrc

Then the default bashrc execution gave this:

/home/me/.bashrc:type:90: bad option: -P
zsh: command not found: shopt
zsh: command not found: shopt
zsh: command not found: shopt

May caused by:

shopt -s checkwinsize
shopt -s expand_aliases
shopt -s histappend
type -P dircolors >/dev/null

Is there a way to do “full bash emulate”?

Bash is bash and zsh is zsh. You can’t just mix and match either shell’s specific commands. Either create you own profile without invoking /usr/bin/zsh if you want to use bash or change user shell to zsh.
And you can search for equivalent shell commands if they exist.

Thanks for your explanation, I will try this.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.