rbenv-sudo icon indicating copy to clipboard operation
rbenv-sudo copied to clipboard

Request: Enable passing of -E (--preserve-env) flag to sudo

Open ewollesen opened this issue 9 years ago • 1 comments

From the man page:

-E, --preserve-env Indicates to the security policy that the user wishes to pre‐ serve their existing environment variables. The security policy may return an error if the user does not have permis‐ sion to preserve the environment.

I find this useful like so:

$ VAR1=foo rbenv sudo ./my-script

For the time-being, I can edit the script and add the -E flag, but it's not something I always want (or should always have turned on).

ewollesen avatar Aug 17 '15 20:08 ewollesen

Alternately, you can do the following:

VAR1=foo
rbenv sudo VAR1=$VAR1 ./my-script

rjmooney avatar Dec 09 '17 09:12 rjmooney