Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: "su -m" (on Mac) preserves $HOME and $USER but not ~ Date: Thu, 29 Oct 2015 16:00:06 -0400 Lines: 24 Approved: bug-bash@gnu.org Message-ID: References: <20151029170210.0ACA061A6C27@triton.parabon.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1446148841 32544 208.118.235.17 (29 Oct 2015 20:00:41 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: dabe@dabe.com Envelope-to: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <20151029170210.0ACA061A6C27@triton.parabon.com> User-Agent: Mutt/1.4.2.3i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11797 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! 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?