So I have this path as my present working directory:
Using a bash script, I want to determine if this directory is within my user home directory and if so, also check to see if
/home/$USER/<dir> ==? /home/$USER/.nvm
In other words, looking to check if the first directory in the path below my user home, is named ".nvm".
What is the best way to do this? (Ideally this could also run on MacOS).
All I really need to do is check if
but doing that in bash, not sure