-1

Ok so I had a problem that is now fixed. I was trying to add a path in my .profile but it would only work if I'd source my .profile every time a new terminal was open. It forgot about the new path every time I exited terminal. Found a solution in this post.

What I did to fix it was

echo "source ~/.profile" >> .bash_profile
echo "source ~/.profile" >> .bashrc

My question is, I am still not done installing programs that need a path added to .profile, so after I add those paths, will I need to run the above code again?

I am not really sure what it is doing. I know it's copying the content of .profile to the other two, but don't know if as text or telling it to go to .profile after it's done going through them.

I couldn't comment on the post that helped me because I dont have the reputation necessary to do it. Thanks!

Community
  • 1
  • 1
M.O.
  • 476
  • 7
  • 19
  • 3
    no. All commands from .profile will be executed from now when opening a bash. Doing it once again could be harmful: adding twice to the path, etc... – Jean-François Fabre Dec 04 '16 at 20:05
  • `~/.profile` is for login shells, `~/.bashrc` is for interactive shells, see: `man bash | sed '/^FILES$/,/^$/!d'` – Andreas Louv Dec 05 '16 at 00:47

1 Answers1

0

No. You don't need to execute the code again after adding more paths to .profile.