Shell Adding /usr/local/opt/bin to default $PATH

I want to add /usr/local/opt/bin to the default $PATH for all users. What is the cleanest way to do this?
 
This question depends on the shell you are using. If you are using csh(1), add the custom $PATH to /etc/csh.cshrc. If you are using sh(1), then you can edit /etc/profile. Other shells will have their own file locations and you should consult your shell's man pages to find out what they are.
 
Editing /etc/csh.cshrc and /etc/profile work for normal users, but not for root. Is adding /usr/local/opt/bin to the path in /root/.cshrc a bad idea?

Also, is modifying the default path in /etc/login.conf a bad idea?
 
Editing /etc/csh.cshrc and /etc/profile work for normal users, but not for root. Is adding /usr/local/opt/bin to the path in /root/.cshrc a bad idea?

It should; but from memory, there's a default /root/.cshrc which resets some options. I suspect this is the same for sh.
 
Back
Top