I set the $ PATH variable in the / etc / profile file like this:
export PATH=$PATH:/usr/app/cpn/bin My team is in:$ which ydisplay /usr/app/cpn/bin/ydisplay
Thus, when I execute echo $PATH , the result looks like this:
$ echo $PATH ...:/usr/app/cpn/bin
And everything works fine, but when I try to do the same for SSH, I get the following error:
$ ssh 127.0.0.1 ydisplay $ bash: ydisplay: command not found But at the same time, as you can see, my path is in place:$ ssh 127.0.0.1 echo $PATH ...:/usr/app/cpn/bin
Please explain to me why this is happening and how to properly configure $ PATH?
The most mysterious thing for me is that if you specify $ PATH in the same way in a user’s .bashrc file, everything works fine. However, I do not want to modify each .bashrc file for each user; instead, I want to make changes only in / etc / profile.
I suspect that this is a feature of the non-interactive Shell.