Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2009 15:54:19 -0400
From:      Jon Radel <jon@radel.com>
To:        Daniel Underwood <djuatdelta@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: su'ing not sourcing .bash_profile
Message-ID:  <49F218EB.5040805@radel.com>
In-Reply-To: <b6c05a470904241243h97b02c9m983b25d19a3db70@mail.gmail.com>
References:  <b6c05a470904241243h97b02c9m983b25d19a3db70@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Daniel Underwood wrote:
> When I am logged in as a non-root user and I try to become root by
> entering "su" and typing the root password, the resulting bash prompt
> does not reflect the contents of /root/.bash_profile
> 
> My /root/.bash_profile contains (among other things):
> 
> export PS1="[\e[1;31m\]$(tput bold)\u$(tput sgr0)\[\e[0m\]@\h \w]\$ "
> 
> The point is to make the username ("root") display in BOLD and RED
> text.  After su'ing, the text is not bold nor red.  If I then enter
> "source ~/.bash_profile", however, the prompt displays correctly,
> showing "root" in bold and red text.
> 
> How come su'ing doesn't seem to effect everything in the
> /root/.bash_profile file?
> 
> Thanks,
> Daniel

Read the man page on the distinction between

su

and

su -

the latter probably being what you want to use.

-- 

--Jon Radel
jon@radel.com

[-- Attachment #2 --]
0	*H
010	+0	*H
	100\^
Xq0
	*H
0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA0
090225041326Z
100225041326Z0^10URadel10U*
Jon Thomas10UJon Thomas Radel10	*H
	
jon@radel.com0"0
	*H
0
O箩js;:|+\&W4fMcjDX&̡4g;}we62xrqF?6K#zjdf~pC.l5ծ>f%!T`O\BIe Gv$l\9BbkOBHnKl-q;
MlL (ٕ ,OJ%gCqb!?hض2y*0(0U0
jon@radel.com0U00
	*H
SWWƳN&⼮i#E[%Ҟ';uT}|m}^yըO-ʧ}BYp#tcSu
Bj8+G$bC4g/qi
77Stڄկ<`SNfT00\^
Xq0
	*H
0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA0
090225041326Z
100225041326Z0^10URadel10U*
Jon Thomas10UJon Thomas Radel10	*H
	
jon@radel.com0"0
	*H
0
O箩js;:|+\&W4fMcjDX&̡4g;}we62xrqF?6K#zjdf~pC.l5ծ>f%!T`O\BIe Gv$l\9BbkOBHnKl-q;
MlL (ٕ ,OJ%gCqb!?hض2y*0(0U0
jon@radel.com0U00
	*H
SWWƳN&⼮i#E[%Ҟ';uT}|m}^yըO-ʧ}BYp#tcSu
Bj8+G$bC4g/qi
77Stڄկ<`SNfT0?0
0
	*H
010	UZA10UWestern Cape10U	Cape Town10U
Thawte Consulting1(0&UCertification Services Division1$0"UThawte Personal Freemail CA1+0)	*H
	personal-freemail@thawte.com0
030717000000Z
130716235959Z0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA00
	*H
0Ħ<UsUNʙZhup[v:aQP
0cZ,p+Z?qV˯<6$*+w=+>@dקe*TH<a@dr`00U00CU<0:08642http://crl.thawte.com/ThawtePersonalFreemailCA.crl0U0)U"0 010UPrivateLabel2-1380
	*H
HP.
fgCL!6-6/P p<ab:~t%Pb'qW%ݩ9 Oe_N4[5MwV!x!5$F]_eO1d0`0v0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA^
Xq0	+0	*H
	1	*H
0	*H
	1
090424195419Z0#	*H
	1M#<p!^:&WT0R	*H
	1E0C0
*H
0*H
0
*H
@0+0
*H
(0	+71x0v0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA^
Xq0*H
	1xv0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA^
Xq0
	*H
?F+#é1E}C~o;mK.ωQWʰ.ssLK1TBšJ%	ʂ^m|gQ/M~Y|cxI|Va
fqᙑ 
bt%9,Ҡg]ؕf	]#$
KVJuMi4Ŵ$z&)\ڦ}83#7 9qZ)W(`
7azS]L4]<

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49F218EB.5040805>