On Sun, Aug 30, 2026 at 07:14:43PM -0700, Collin Funk wrote:
> AFAIK,
> sudo only allows you to preserve the entire environment or specific
> variables. I.e., there is no way to set a variable to a given value.

Hi Collin,

Would the --preserve-env option be of any help?

TERM=xterm X1=4 X2=2 NOT=no \
        sudo --preserve-env=X1,X2 sh -c 'echo $TERM $X1$X2 $NOT'


-- 
Regards, Mike Jonkmans

Reply via email to