Is there a way (without jumping through too many hoops) to run
user command in such a way that
user's environment is entirely preserved?
Basically, what I need is to ensure that specific environment variables are set for all users allowed to run sudo to impersonate certain IDs - mostly things like
JAVA_HOME, and database-related (Oracle and Postgres) variables.
In other words - when I, as the user
sudo -u wibble echo $PATH I'd like to see
wibble's path displayed instead of