Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 7826  / 3 Years ago, wed, october 6, 2021, 12:54:48

Possible Duplicate:

How to add a directory to my path?






I created a .bash_aliases file with the following contents:



PATH=$PATH:$HOME/opt/bin


So it adds /home/myuser/opt/bin to $PATH.
I made this because I don't have root access to this machine.



When I run apps interactively through the shell command line, they can understand my custom PATH with no problems. But, if I open a app outside the shell command line, for example, choosing from the unity dash, the same apps can't see my custom PATH.



I tried putting shopt -s expand_aliases in my .bash_aliases, but without success.



How can I set a PATH for environments other than BASH?


More From » paths

 Answers
1

If you're running apps outside the shell command line that will always run with your UID, you can create session-wide environment variables by adding them to ~/.pam_environment, rather than .bash_aliases.



If you're running apps outside the shell command line that will not always run with your UID, system-wide environment variables by adding them to /etc/environment, rather than .bash_aliases.



However: Creating system-wide environment variables will affect ALL users, including root. If the variable you set overwrites another, bad things will happen. Adding something onto the end of PATH doesn't seem like it will cause any havoc, but seeing as you don't have root, you would need your sysadmin to do it for you, and s/he can probably advise you as to whether it is safe to add it. Whether s/he actually allows you to do this is something else entirely; anything user-related is best kept within the config files within their home folder, and it is not normally 'done' to have a users configuration affecting the whole system!


[#33440] Thursday, October 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
splenueak

Total Points: 448
Total Questions: 118
Total Answers: 110

Location: Vanuatu
Member since Mon, Oct 3, 2022
2 Years ago
;