Post History
but it clearly does see that change. Nope. Your environment is being reloaded in the sudo process. sudo echo $PATH gives the same result as echo $PATH because $PATH is expanded by your shell ...
Answer
#1: Initial revision
> but it clearly *does* see that change. Nope. Your environment is being reloaded in the `sudo` process. `sudo echo $PATH` gives the same result as `echo $PATH` because `$PATH` is expanded by your shell first thing, before `sudo` gets spawned. If you want to see the value of `PATH` from inside `sudo`, run `sudo bash -c 'echo $PATH'` instead.