I have a system wide install of a software . The source is located at /opt/Software . There is a bashrc file of the Software which is needed to be sourced for every user using it . Will the addition of


source $PATH_TO_SOFTWARE_BASHRC
to their ~/.bashrc work for all users ? How should I set the permissions for the file at $PATH_TO_SOFTWARE_BASHRC so that all the users can access the software ?

link|improve this question
feedback

2 Answers

Just put that code in /etc/bashrc and every user will have it.
If there will be some permission issues, use chown/chmod to fix that.

link|improve this answer
I find no reference to /etc/bashrc in the Bash documentation. – Dennis Williamson Jul 29 '10 at 14:33
There is the reference, check the --rcfile description. This filename may vary on various distributions. For Ubuntu it is /etc/bash.bashrc. – Andrejs Cainikovs Jul 29 '10 at 15:29
Actually, in the original manual there's only a reference to /etc/profile. So apparently any other files in /etc are installation dependent, but the original docs don't say anything about this either. – Dennis Williamson Jul 30 '10 at 9:14
feedback

Set the permissions of the file to be world readable:

chmod 644 /path/to/your/file

Some shells don't understand the source command, so to make it work more broadly use:

. /path/to/your/file

even though it appears that you may only be using Bash.

Put that in each users' ~/.bashrc or to make it simpler, put it in /etc/bash.bashrc so it's available to every user without having to maintain it in individual files.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.