Re: su'ing not sourcing .bash_profile
Because .bash_profile is only seen on login, not on 'su'. Put it in .bashrc which is read when the shell is invoked. See 'man bash' Patrick Daniel Underwood presented these words - circa 4/24/09 12:43 PM-> 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[0...@\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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: su'ing not sourcing .bash_profile
Hi, > > 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 > Because .bash_profile is only seen on login, not on 'su'. Put > it in .bashrc which is read when the shell is invoked. su - maybe? If you can live with ending up in ~root/, of course ;-) Rgds., Peter. -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: su'ing not sourcing .bash_profile
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[0...@\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 j...@radel.com smime.p7s Description: S/MIME Cryptographic Signature
Re: su'ing not sourcing .bash_profile
You're right. Works now. Many thanks! On Fri, Apr 24, 2009 at 3:51 PM, Adam Vandemore wrote: > 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[0...@\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 >> ___ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to >> "freebsd-questions-unsubscr...@freebsd.org" >> >> > > I think you may need to set that in ~/.bashrc > > -- > Adam Vandemore > Systems Administrator > IMED Mobility > (605) 498-1610 > > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: su'ing not sourcing .bash_profile
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[0...@\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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" I think you may need to set that in ~/.bashrc -- Adam Vandemore Systems Administrator IMED Mobility (605) 498-1610 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
su'ing not sourcing .bash_profile
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[0...@\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 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"