开发者

Changing the environment variable permenantly in Ubuntu 10.10

Friends, I want to make change to environment PATH system wide. Because I have program called "md5". I want to execute it from anywhere (i.e any directory).

My md5 program is located at "/home/ahuq/MappingServer/md5_program". So what I did was to put: "export PATH=$PATH:/home/ahuq/MappingServer/md5_program" in the running SHELL. This only makes temporary changes and lets me run the "md5" program from anywhere temporarily. But I want to make this change permanent. So what I did was to put the "PATH=$PATH:/home/ahuq/MappingServer/md5_program" line into the "/etc/environment" file. This screwed everything up and then for a while I couldn't execute anything from SHELL. I knew the absolute path of "nano" editor and used it to modify the file (i.e. /et开发者_JS百科c/environment) back to its original condition. This fixed the problem and now I can run programs like "ls" from the SHELL.

But still I need a way to permanently add the path of "md5" to the environment. How can I do this in Ubuntu 10.10? Which file needs to edited?

Bye.


It looks like your adding the 'program' to the path, you only want to add the directory to the path.

Try

PATH=$PATH:/home/ahuq/MappingServer

added to where your PATH is defined in a .profile.

I hope this helps.

P.S. as you appear to be a new user, if you get an answer that helps you please remember to mark it as accepted, and/or give it a + (or -) as a useful answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜