bash - 如何通过命令行选项加载不同的 zshrc 文件?

标签 bash zsh

我以前用 bash 来做这个......

/bin/bash --rcfile /home/sindhu/bin/misc_scripts/shellrc/.bashrc_1

我怎样才能用 zsh 完成同样的事情?

谢谢。

最佳答案

您可以使用 ZDOTDIR 变量来近似该特征。

在这样的目录中:

mkdir /home/sindhu/bin/misc_scripts/shellrc/.zshrc_1

创建一个名为 .zshrc 的文件,其中包含您的备用启动脚本。然后你就可以像这样启动 zsh 了:

ZDOTDIR=/home/sindhu/bin/misc_scripts/shellrc/.zshrc_1 zsh

关于bash - 如何通过命令行选项加载不同的 zshrc 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2727172/

相关文章:

python - 在 bash 脚本中调用 python 脚本会更改变量的类型

git - Shell - 检查 if/else 语句中是否存在 git 标签

linux - 多个字符串到一个字符串比较bash

在 bash 脚本上调用 execve bash 找不到参数

linux - zsh提示功能不起作用

bash - shell : logical ANDs and ORs instead of if-else

linux - BASH 变量值作为新定义的变量

python - zsh:未找到匹配项:请求 [安全]

zsh - 如何让 kill <tab> 显示 ps 显示的进程

zsh - 访问 Zsh 中的最后一个命令(不是上一个命令行)