I have a spurious path in my ~PATH~ environment variable in Ubuntu:


I have no idea where it is set. I have checked these files:


Any idea where else it can be or how can I find it?


I cannot find out, where it is set, i is not in /etc/skel, too, nowhere in /etc and nowhere in /home/. But I found out, why it is set. I also started bash with -x to see, what happens, but the only thing I can see there is

complete -F _service /etc/init.d/lightdm

and I cannot find references to PATH or set there (No wonder, the initscript has been converted to an upstart job). But, to calm you, this is default behaviour in Ubuntu.

| improve this answer | |

Notably missing from the list is ~/.bash_profile. I recommend checking there (if you have not done so).

This file doesn't always exist, and it's not a problem when it doesn't. However, if it does exist, it is executed by initial login shells instead of .profile. (So if it doesn't itself run or source .profile, .profile will not run at all.)

That's just in bash of course. .bash_profile is ignored by other shells--it's a good place to put commands that are bash-specific (so long as you make sure to source .profile in it if there's code there that needs running).

For more information on startup scripts, see man bash.

| improve this answer | |
  • I don't have this file at all – rowman Jan 23 '13 at 10:00
  • @rowman In that case, that's not it. (Edited to generalize for others.) – Eliah Kagan Jan 23 '13 at 10:04

Your Answer

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

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