Just tried it. Two items. Path ends up having /home/john/bin: in it, along with valid root path entries.
History ends up as root's history, not john's history On 01/24/02, 01:33:56PM +1100, Cameron Simpson wrote: > On 21:14 23 Jan 2002, John P Verel <[EMAIL PROTECTED]> wrote: > | I frequently su from my user account to root. According to the su info, > | it starts a new interactive shell, leaving the environment unchanged. > | > | What I'd like to do is: > | > | su to root > | pick up root's path > | pick up user's history file > | not change directory to ~/root, but keep the current directory > | > | Can I do all this? Doing the first two is easy, especially by just > | invoking su as a login shell. But I can't figure how to do the last > | two. > > su root -c ". /etc/profile; . /root/.bash_profile; export HISTFILE=$HISTFILE; exec >bash -i' > > Cheers, > -- > Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/ -- John P. Verel Living Proof That Low Tech Beats High Tech! _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list