I have always been thinking about the effective way of managing environment variables in operating systems like Ubuntu, macOS, etc.. I have a couple of questions related to it.
Is there a common sense that every single executable software installed on the system should be available system-wide in terms of invocation ? Or executables should be only invoked by shell in default ?
I have been seeing exporting shell variable to extend PATH variable method everywhere. But it is only applied in one shell. Because every shell has its own file for initialization. We need to write the same statement in every shell file. For example if I use zsh, I should to do like this:
echo 'export PATH="/path/to/bin:$PATH"' >> ~/.zshrc
- Those programs which is not in system-wide path, cannot not be invoked directly by another program. I guess it is a kind of isolation between default executables and others to make system path clean. Then we shouldn't manipulate system-wide PATH ?
I may confuse a little bit, sorry for it. But I would really appreciate if you could help me make it clear.