I added to the path in ~/.profile and the path will be updated if I

source ~/.profile 

but on system restart, ~/.profile is not loaded. How can I make it automatic so I don't have to source it? Is ~/.profile the right place to add to the path for something like grails bin?

6

2 Answers

You need to invoke bash with either -l or --login to make it a login shell, one that looks for and reads ~/.profile. For more, refer to the INVOCATION section in man bash.

If there's something you want bash to run every time, not just when you make it a login shell, put that into ~/.bashrc, not ~/.profile.

If you're trying to decide what should go where, put stuff that can be inherited, e.g., environment variable settings into ~/.profile and stuff that can't, like alias definitions into ~/.bashrc.

Just a wild guess as you do not state what OS you are running.

Assuming you are running a CDE desktop, make sure you have a line that reads

DTSOURCEPROFILE=true 

at the end of your ~/.dtprofile

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy