I installed some programs in /opt/my-program/bin, I wanted to add /opt/my-program/bin to system $PATH for all users's non-login shell and login shell. What should I do?
Changing /etc/environment is OK for non-login shell, but it does not work for login shell because Debian's /etc/profile (which will be sourced by login shell) will override the $PATH specified in /etc/environment.
/usr/local/bin
without altering environment variables.cd $(basedir "$0")
. Symlinks cause$0
changes./usr/local/bin
or~/bin
.PATH
in/etc/profile
(at least for non-root users)?