[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "su -m" (on Mac) preserves $HOME and $USER but not ~
From: |
Greg Wooledge |
Subject: |
Re: "su -m" (on Mac) preserves $HOME and $USER but not ~ |
Date: |
Thu, 29 Oct 2015 16:00:06 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Thu, Oct 29, 2015 at 01:02:10PM -0400, dabe@dabe.com wrote:
> Check out this copy-paste:
>
> Thu Oct 29 12:32:22 dabe@triton:~> su -m root -c "bash"
> Password:
> Thu Oct 29 12:32:26 root@triton:~# echo $HOME ... ~
> /Users/dabe ... /Users/dabe
> Thu Oct 29 12:32:27 root@triton:~# echo $HOME ... ~
> /Users/dabe ... /Users/dabe
> Thu Oct 29 12:32:28 root@triton:~# echo $HOME ... ~
> /Users/dabe ... /Users/dabe
> Thu Oct 29 12:32:28 root@triton:~# echo $HOME ... ~
> /Users/dabe ... /var/root
> Thu Oct 29 12:32:28 root@triton:~# echo $HOME ... ~
> /Users/dabe ... /var/root
>
> Notice how my $HOME stays the same (good) but my ~ changes
> to /var/root -- and it changes AFTER I've been logged in for
> a little while! <scratching head>
Do you have a PROMPT_COMMAND variable? Or something unusual in your
PS1 variable? (Doesn't look it from the copy/paste, but you never
know.) Or do you have a DEBUG trap?