Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm currently trying to configure a server using Precise Pangolin and Vagrant (a software allowing me to provision a number of software when booting my VM).

My current question is a pure bash one.

I've discovered that my .bashrc file is already filled with interesting commands. I want, in a way or another, to add this cool maven.bashrc colorizing to my bash. How can I do that without hand-editting my .bashrc ?

Notice I can (and in fact already have) write files into /etc/profile.d. is it recommended for that kind of stuff ?

share|improve this question

1 Answer 1

You can do one of two things.

  1. Add the commands to the end of .bashrc.
  2. Create a new file (I create one in a folder ~/.bin, which is automatically added to your path when you login). Source the file at the end of your .bashrc. For example, if your file is called bashextras, add the line:
    . ${HOME}/bin/bashextras

/etc/profile and /etc/profile.d affect every user on the system, not just you. So, unless you specifically want every user to be affected, it is best to use only your own .bashrc (affects only your terminal sessions) or .profile (run at login and affects your entire session).

share|improve this answer
    
Yes but there is no way to "just drop" bash files at a convenient location ? –  Riduidel Jan 25 '13 at 14:39
    
I'm sorry, I don't know what you mean. Are you asking where you can place scripts ("bash files") so that the system finds them? The folder ~/bin (that's bin within your home folder) is automatically added to your path. If the folder does not yet exist, create the folder, log out, and log in again. However, this is not what your original question asks. –  Paddy Landau Jan 25 '13 at 18:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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