Right now I tried to use zsh from normal Ubuntu bash. When I changed to zsh shell, I found previously environment variables (e.g. JAVA_HOME) in .bashrc
can not migrate to .zshrc
automatically. Now I just copy them (export, alias in .bashrc) to .zshrc
. I want to know is there other convenient way to share these thing in .bashrc
and do not need copy them explicitly? And even when I add something in .zshrc
and then change to normal bash still could share them in .zshrc
without copy them to .bashrc
.
I tried to source .zshrc
in .bashrc
, then change to bash, found below error
exec bash
autoload: command not found
bash: /home/zhuguowei/.oh-my-zsh/oh-my-zsh.sh: line 31: syntax error near unexpected token `('
bash: /home/zhuguowei/.oh-my-zsh/oh-my-zsh.sh: line 31: `for config_file ($ZSH/lib/*.zsh); do'
And in .zshrc
I also tried source .bashrc
, have error too
source .zshrc
/home/zhuguowei/.bashrc:16: command not found: shopt
/home/zhuguowei/.bashrc:24: command not found: shopt
/home/zhuguowei/.bashrc:108: command not found: shopt
/usr/share/bash-completion/bash_completion:35: parse error near `]]'
\[\e]0;\u@\h: \w\a\]\u@\h:\w$