Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11797

Re: "su -m" (on Mac) preserves $HOME and $USER but not ~

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
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 <mailman.1271.1446148841.7904.bug-bash@gnu.org> (permalink)
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 <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:11797

Show key headers only | View raw


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?

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: "su -m" (on Mac) preserves $HOME and $USER but not ~ Greg Wooledge <wooledg@eeg.ccf.org> - 2015-10-29 16:00 -0400

csiph-web