Hi:
I have a program that I wanted to add to the $PATH environment variable. Now, I've done it successfully for regular users, but unfortunately when I prepend sudo in front of it (to run it as root), I get
where myapp is the name of the program. I have read around and tried various solutions, but nothing seems to work:Code:"sudo: myapp: command not found"
- Adding "export PATH=$PATH:path_to_myapp" to /root/.bashrc
- Adding "export PATH=$PATH:path_to_myapp" to /root/bash_profile
- Appending path_to_myapp to both ENV_SUPATH and ENV_PATH in /etc/login.defs
I tried each solution in isolation (i.e., I tried approach #1, then reversed my changes and tried approach #2, etc.), and also logged-out/logged-back-in after each approach.
I know they don't work because when I type
the $PATH variable does not reflect my changes.Code:sudo env
I would appreciate any help on this matter.
Cheers,
LK
Bookmarks