When running sudo <command> under a user login session, will thatchange $PATH to be the root's $PATH during the running of sudo<command>?If <command> relies on the user's $PATH, not the root's $PATH,how can the user run sudo <command> successfully?One way is to sudo su to be the root,  change the root's$PATH  to be the user's, and run <command> directly. This is how I solved my problem ofHow to specify a higher ruby version for installing a gem?.Any way simpler?Can it be done without switching to the root from the user?
Does sudo a command temporarily change $PATH to be the root's?
sudo;path