help-bash
[Top][All Lists]
Advanced

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

Re: prob , PATH inheritage | early modment , sudo , wsl deb


From: alex xmb sw ratchev
Subject: Re: prob , PATH inheritage | early modment , sudo , wsl deb
Date: Sat, 10 Feb 2024 04:18:42 +0100

On Sat, Feb 10, 2024, 04:04 alex xmb sw ratchev <fxmbsw7@gmail.com> wrote:

> i have :
> wsl debian , starting that windows app brings up terminal and normal user
> is logged in
>
> i wanna do :
> auto login to root , and have the from-user /mnt/c/*windows* PATHs
>
> i did :
> a login bashrc / profile that saves the extra paths to a var
> and have /root/*somebashrc* add that to PATH
> cause i couldnt make it neither inherit nor early-add , to PATH , BASH_ENV
> nor --init-file worked
>
> my cmdline :
> sudo HOME=/root sps="${PATH#*:/bin:}" bash -l < optional args bad code >
>
> ? why only rc file in /root fix this problem ?
>
> i had tried and failed :
> a_code = printf %s\\n 'PATH+=:$sps'
> sudo BASH_ENV=<( a_code ) bash -l
> sudo bash --init-file <( a_code ) -l
> sudo bash --init-file /dev/fd/3 3< <( a_code )
>
> i also of course removed all bashrc profiles in /root and /etc
> it always forced root sbin paths , without my :$sps additon
> the $sps is filled
>
> works : rc file in /root
>  [[ $sps ]] &&
> PATH+=:$sps sps=
>
> but why no init file or bash env do
> what i do wrong
> what i missed
>

may be related : that i had to HOME=/root
from my initial tries
had HOME=/root sudo -E bash -l
if i didnt set home it d stay /home/xmb

greetings , microsuxx softwāār
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]