You can change $PATH for one command with a little trick:
$ sudo PATH=$PATH sh -c 'echo $PATH'
to use the user's $PATH. You can set it to anything else, too.
However, I agree that it would be nice to provide a sudoers configuration variable to change the default.
You can change $PATH for one command with a little trick:
$ sudo PATH=$PATH sh -c 'echo $PATH'
to use the user's $PATH. You can set it to anything else, too.
However, I agree that it would be nice to provide a sudoers configuration variable to change the default.