I'm trying to sudo some binaries that lies in a custom path. That custom path is removed when I run sudo
though, but sudo -E
should preserve my path. Why doesn't it work?
$ env | egrep ^PATH PATH=/home/codemonkey/.nvm/v0.6.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/gam es:/usr/games $ sudo env | egrep ^PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin $ sudo -E env | egrep ^PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
I know how to work around it, I just want to know why sudo -E
doesn't work