如何通过命令行选项加载不同的 zshrc 文件? [英] How to load different zshrc file via commandline option?

查看:28
本文介绍了如何通过命令行选项加载不同的 zshrc 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经用 bash 来做这件事...

I used to do this with bash...

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

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

how can I accomplish the same with zsh?

谢谢.

推荐答案

您可以使用 ZDOTDIR 变量来近似该功能.

You can approximate that feature by using the ZDOTDIR variable.

在一个可能像这样的目录中:

In a directory perhaps like this:

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

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

create a file called .zshrc containing your alternative startup script. Then you can start zsh like this:

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

这篇关于如何通过命令行选项加载不同的 zshrc 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆