Friends, I want to add my C program's path to the environment variable PATH. My C program called "md5". So that I can 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:
in the running shell. This only makes temporary changes and lets me run the
md5 program from anywhere temporarily.
root@ahuq-kitchen:/home/ahuq# md5 -sanis MD5 ("anis") = 38a1ffb5ccad9612d3d28d99488ca94b
But I want to make this change permanent.
I tried to put the line
PATH=$PATH:/home/ahuq/MappingServer/md5_program at the end of
/home/ahuq/.profile files. I logged out of the shell and
went in again. But it didn't work:
root@ahuq-kitchen:/home/ahuq# md5 -sanis No command 'md5' found, did you mean: Command 'cd5' from package 'cd5' (universe) Command 'mdu' from package 'mtools' (main) Command 'mdb' from package 'mono-debugger' (universe) md5: command not found
Maybe I am putting the
PATH statement in the wrong place of the above mentioned files. There are a lot if-else-fi structures inside those two files. Do I need to put the
PATH statement inside any of those structures? Do I just logout or do I have to restart the system to make the changes active?