Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load different zshrc file via commandline option?

Tags:

bash

zsh

I used to do this with bash...

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

how can I accomplish the same with zsh?

Thank you.

like image 438
user327523 Avatar asked Apr 28 '10 06:04

user327523


People also ask

How do I open a Zshrc file on a Mac?

Open Terminal > and type: open ~/. zshrc.

Where is Zshrc file Linux?

zshrc file located in your home directory. It's a hidden file, so you might not see it in your home directory, but you can view it by running open ~/. zshrc from the terminal.


1 Answers

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

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
like image 180
Dennis Williamson Avatar answered Oct 04 '22 21:10

Dennis Williamson