Import .bashrc file to .zshrc

I’ ve installed Manjaro 21.1.6 Pahvo and I found it comes with zsh by default which is great, but my issue is next. When I install nvm from its github repository the installation updates my .bashrc but not the .zshrc file, of course, I can copy the exporting part of nvm from .bashrc to zshrc and have it ready, but my question is. How to import all the configurations from .bashrc in the .zshrc file so that I’ll touch it just once? Thanks in advance.

Well, a copy-paste is enough if you don’t expect to get more bashrc updates.
Just be sure to have set zsh as default shell.

1 Like

For the more automatic import/emulate approach this is supposed to work:

In ~/.bashrc:

source ~/.profile

In ~/.zshrc:

[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'
1 Like

thanks but I can’t find that .profile file, this is what my ls -al output


total 212
drwx------ 24 citma citma  4096 Oct 27 13:17 .
drwxr-xr-x  3 root  root   4096 Sep  7 05:19 ..
-rw-------  1 citma citma  5586 Oct 27 10:47 .bash_history
-rw-r--r--  1 citma citma    21 May 26 11:51 .bash_logout
-rw-r--r--  1 citma citma    57 May 26 11:51 .bash_profile
-rw-r--r--  1 citma citma  4016 Oct 25 08:27 .bashrc
drwxr-xr-x 31 citma citma  4096 Oct 27 13:17 .cache
drwxr-xr-x 34 citma citma  4096 Oct 27 13:17 .config
drwxr-xr-x  2 citma citma  4096 Oct  6 14:23 Desktop
drwxr-xr-x  4 citma citma  4096 Oct 27 09:53 Dev
-rw-r--r--  1 citma citma  4855 Oct 29  2017 .dir_colors
drwxr-xr-x  3 citma citma  4096 Oct 27 09:10 Documents
drwxr-xr-x  4 citma citma  4096 Oct 27 10:06 Downloads
-rw-r--r--  1 citma citma  3740 Aug  4  2020 .face
lrwxrwxrwx  1 citma citma     5 Aug  4  2020 .face.icon -> .face
-rw-r--r--  1 citma citma   110 Sep  7 14:19 .fonts.conf
-rw-r--r--  1 citma citma    58 Oct 21 11:53 .gitconfig
-rw-r--r--  1 citma citma   343 Oct 27 11:09 .gtkrc-2.0
drwxr-xr-x  3 citma citma  4096 Sep  7 05:21 .kde4
-rw-------  1 citma citma    20 Oct 27 09:20 .lesshst
drwxr-xr-x  5 citma citma  4096 Sep  7 14:16 .local
drwx------  6 citma citma  4096 Oct 19 13:46 .mozilla
drwxr-xr-x  2 citma citma  4096 Sep  7 05:21 Music
drwxr-xr-x  4 citma citma  4096 Oct 27 10:05 .npm
drwxr-xr-x  8 citma citma  4096 Oct 25 10:05 .nvm
drwxr-xr-x  4 citma citma  4096 Oct 27 13:15 Pictures
drwx------  3 citma citma  4096 Sep  7 13:00 .pki
drwxr-xr-x  2 citma citma  4096 Sep  7 05:21 Public
drwx------  7 citma citma  4096 Oct 27 10:27 .purple
-rw-------  1 citma citma     0 Sep  7 14:16 .python_history
drwx------  2 citma citma  4096 Oct 25 15:55 .ssh
drwxr-xr-x  2 citma citma  4096 Oct  6 14:23 .steam
lrwxrwxrwx  1 citma citma    30 Oct  6 14:02 .steampath -> /home/citma/.steam/sdk32/steam
lrwxrwxrwx  1 citma citma    28 Oct  6 14:02 .steampid -> /home/citma/.steam/steam.pid
drwxr-xr-x  2 citma citma  4096 Sep  7 05:21 Templates
drwxr-xr-x  2 citma citma  4096 Sep  7 05:21 Videos
drwxr-xr-x  3 citma citma  4096 Sep  7 13:00 .vscode
drwxr-xr-x  3 citma citma  4096 Sep  7 13:06 .vscode-oss
-rw-------  1 citma citma    52 Oct 27 11:08 .Xauthority
-rwxr-xr-x  1 citma citma   100 Oct 29  2017 .Xclients
-rwxr-xr-x  1 citma citma  1637 Aug  4  2020 .xinitrc
-rw-r--r--  1 citma citma 47357 Oct 25 15:47 .zcompdump
-rw-------  1 citma citma  2460 Oct 27 13:12 .zhistory
-rw-r--r--  1 citma citma   490 Oct 25 10:04 .zshrc

Tip: When pasting terminal output on Discourse forums, one can either…

  • Highlight it and use the Preformatted text </> toolbar button.

  • Add three backticks ` above and below the text (Markdown):

    ```
    text
    ```

  • Use HTML:

    <pre><code>
    text
    </pre></code>

Please edit your post accordingly.

1 Like

huge thanks mate!

Its a bash thing. you can just make it.

touch ~/.profile
1 Like

million thanks, it worked, but I had to load a bash profile in the console