0

I want to add to my PATH variable a folder containing personal scripts (for example ~/myTools). As I've read on forums and tutorials, if I put the corresponding commands (add to PATH and export) to the .bashrc file, the path is correctly modified for anything I launch from a terminal, be it launching a script contained in ~/myTools directly from command line or launching a script that itself does it. But, if I try to launch a script that use something from ~/myTools BY ITSELF, i.e. without calling it from a terminal, then the PATH modification in .bashrc is not made and the script doesn't find things in ~/myTools anymore.

Another example. I write a script "print_path" containing "echo $PATH". If I launch a termi nal and run "print_path" I see that ~/myTools is contained in my path. If I run "print_path" from the desktop (with Linux Mint 17, double-click, "run in terminal"), then the path printed doesn't contain ~/myTools anymore.

How can I modify my path system wide, and not only in a terminal?

1 Answer 1

1

For graphical desktops, you can usually modify environment variables and such in your ~/.profile file. It is executed for login shells (so when You log in via SSH or on a text terminal), but also when you log in to your desktop environment.

Make sure to use export or your changes to PATH are only local to the .profile file itself, of course.

Note that if you use bash, you should manually source the global ~/.profile from your ~/.bash_profile using the . command (or delete the latter file outright). Similarly, if you use zsh, you should manually source that file from your ~/.zprofile, again using the . command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .