[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: setting path for root after "sudo su" and "sudo" for Debian Bullseye (11)



On Sun, May 22, 2022 at 09:02 <tomas@tuxteam.de> wrote:

Socratic -- I fear you over-estimate me badly :-)

You are too modest!

Note that the key --preserve-env takes an arg. That would be

  --preserve-env=PATH

to pass on the PATH environment variable. The arg is a comma separated
list of environment variable names.

Yes, I actually used that syntax but failed to put it in the message—same result: 

     sudo —preserve-env=PATH raku -v
     sudo: raku: command not found

The only thing that worked was:

      $ sudo -i raku -v

and I can live with that for now.

But, if I try making an entry in a sudoer file (to eliminate needing the ‘-i’ arg), is this the right syntax:

    env_keep=PATH

Cheers!

-Tom

Reply to: