Reputation: 8872
I have some setup tooling in zsh that initializes paths, etc. When I run my setup in my .zshrc I execute
. <path>/setup.zsh
Which sources the bootstrapper. I have coworkers who would rather use bash instead of zsh, but I'd like to share all the work done in the zsh scripts. Is it possible somehow exec the zsh file and get the same path setup?
If I do in .bashrc
zsh <path>/setup.zsh
Then the stuff executes fine, but no path variables that were exported in zsh get set in bash
Upvotes: 0
Views: 1351
Reputation: 195029
First of all, a question comes up, why you and your colleague work on the server/machine with same user? Linux/Unix is a multi-user OS, you can have different users, and each user has his own config, shell, .xxxrc files.
If you have to work with same user, one way to go is, extract the common configurations like Variable: PATH etc, Bash functions, alias ...
put it in a shellscript, e.g. ~/.commoncfg.sh
then in your .zshrc
and .bashrc
source this file, to make all the configurations (alias, variables, functions....
work for both shell env.
Upvotes: 1