Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 3976  / 3 Years ago, wed, august 4, 2021, 4:10:30

If I put a new path into my $PATH variable like so:



PATH=$PATH:$HOME/pear/bin/


I can then access the programs in my pear bin. Works as expected, but while I can do this:



phpunit -version


phpunit being a program that resides in my pear bin, I cannot do this:



sudo phpunit -version


as I get the following error:



sudo: phpunit: command not found


does the sudo command not have universal access?


More From » sudo

 Answers
1

I'm not sure about this , but try it.



Maybe you must add the same PATH PATH=$PATH:$HOME/pear/bin/ to the root's PATH variable.



sudo -i
echo $PATH


to see the PATH directories for root.



Then as you are in root account do



ls -a



and you will see .bashrc and .profile files for root account.



Add the line PATH=$PATH:$HOME/pear/bin/ to the appropriate file.


[#32056] Thursday, August 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
strhen

Total Points: 27
Total Questions: 111
Total Answers: 103

Location: Angola
Member since Tue, Apr 25, 2023
1 Year ago
strhen questions
Sun, Jun 6, 21, 04:57, 3 Years ago
Tue, Mar 1, 22, 12:44, 2 Years ago
Wed, Jul 21, 21, 14:38, 3 Years ago
;