I am using MacOS Monterey version 12.0
I checked in root directory, I don't have .bashrc and .bashprofile, but my system is using .zshrc and .zprofile
I am getting error that
./bin/temp.sh: line 3: /Users/xyz/.bashrc: No such file or directory
Code of temp.sh file at line 3 :
#!/usr/bin/env bash
source ~/.bashrc. # This line is causing error
Temporarily, I replaced this line with below and it is working
#!/usr/bin/env zsh
source ~/.zshrc. # This is working fine !!
From searching over few answers and posts, I got to know that Mac systems are transitioning to zsh from bash, because zsh is improved version of bash
Can anyone tell me proper solution of routing .bashrc or .bashprofile commands to fetch internally .zshrc or .zprofile ?
what will be best solution so that same script file can run on both systems having zsh and bash shells?