by lelandfe · 1y ago · 0 comments
While we're here, can someone explain why `which` prints some locations, and for others the whole darn file? Like `which npm` prints the location; `which nvm` prints the whole darn file.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \.
"$NVM_DIR/bash_completion" # This loads nvm bash_completion
to your bashrc.If you write a function in your current session for example which will show you the content of that command. If you write that command in a file and put that file in your path which will show you where it is
If your which command is a shell builtin, and nvm is a function, then you’re likely seeing the content of that function.