I may have a problem in the include chain for the profiles, or something may be awry in either my system, or my understanding of profile.d (RHEL7). I added a /etc/profile.d .sh script which is for a node installation, whilst trying to clean up the .bashrc.  The problem is that it is not appending to the $PATH like i had hoped. Note, the issue is happening both via my main terminal (ssh via putty), but also directly from the console itself as well. $ cat ~/.bash_profile## .bash_profile## Get the aliases and functionsif [ -f ~/.bashrc ]; then        . ~/.bashrcfi$ cat /etc/profile.d/nvm_path.sh# This adds node/nvm(node version manager) to path, and then initializes nvm, and its bash completion#Load NVMif [ -f ~/.nvm ]; then    export NVM_DIR=$HOME/.nvm    [ -s $NVM_DIR/nvm.sh ] && . $NVM_DIR/nvm.sh    if [ -f $NVM_DIR/bash_completion ]; then        [ -s $NVM_DIR/bash_completion ] && \. $NVM_DIR/bash_completion  # This loads nvm bash_completion    fifi# Force npm onto the path (only needed if its not available on your node installation)if [ -f ~/.npm/ ]; then    PATH=$PATH:$HOME/.npmfi# Include node_mod bins in PATH, which are usually symlinked here (gulp,# cordova, etc..)if [ -f $HOME/.npm-packages/bin ]; then    #note is a hyphen, not an underscore    PATH=$PATH:$HOME/.npm-packages/binfiexport PATHFor /etc/profile itself, its my understanding the perms are ok as read-only since they are sourced, as opposed to executed, so i think this isnt an issue. -rw-r--r--. 1 root root 1795 May  4  2016 profileWhat have i missed?  I'm thinking the problem is somewhere along the lines of since the scripts are initially loaded by root the paths are invalid.  the problem, where I try to load the user paths.  What can be done about this?  Do i need to add in a $LOGGED_USER variable in place of if [ -f ~/.nvm ] and maybe even $HOME?  What is that variable?Edit: After further research, it appears the problem is that root is loading the script, so $HOME, even $USER is never available, even if i set a condition in there to check if root is loading or not, since root is always sourcing the script.  e.g. if [[ $EUID -ne 0 ]]; then    USERDIR=$HOMEelse    USERDIR=/home/$USERfiif [ -f $USERDIR/.nvm ]; then#...I would need to have the var check happen once the user logs in, not when root sources it.  It appears something like this is destined for /etc/skel/.bash_profile. Unless someone comes up with a clever bash script idea. Any ideas on how to accomplish this here, so that I don't have to use /etc/skel? 
Why cant I add this custom Node PATH to /etc/profile.d scripts?
terminal;bashrc;putty;profile