Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've written a what I think quite useful function and I want to make it public via GitHub. On my PC I have a .bash_functions file which I source into my .bashrc file. I know this is the common approach (at least for bash) but I don't know if it is very userfriendly to expect from my users to put the function in there manually.

So, my question is, is there maybe some unified global place (somewhere in etc maybe) where I can put my custom functions which get then sourced at startup? So that when the user want's to install this function he just needs to type make and it will be placed into this folder?

share|improve this question

closed as off topic by Michael Hampton, EEAA, HopelessN00b, Scott Pack, John Gardeniers Nov 20 '12 at 0:57

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 5 down vote accepted

I think It's good idea to use .bashrc but if you want a global way then you can put your file with functions in this place

/etc/profile.d/your_file_with_functions.sh

Also you can use other way

/etc/bash.bashrc

and put there

[ -r /path/to/your/file ] && . /path/to/your/file

share|improve this answer

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