[sllug-members]: Environment/Path help
Stuart Jansen
sjansen at buscaluz.org
Tue Dec 12 11:07:33 MST 2006
On Tue, 2006-12-12 at 09:52 -0800, weales at xmission.com wrote:
> Ok, I've been using *nix for over six years (and I feel like a total
> n00b for asking this question), but I need to know how to "source" my
> root user environment variables ($PATH) after I su.
>
> I ssh into systems as a non-root user and then su.
> How can I easily "source" my root environment?
The question you should have asked is "why isn't my environment right
after I su to roo?" The answer would have been because you should be
typing: "su -"
Stuart's Simplified Rule of su is: always use "su -" unless you have a
good reason not to.
Now to answer your real question. The answer is
"source /root/.bash_profile". If you're using ksh, it would instead be
"source /root/.profile". If you're using csh, there's something wrong
with you, see a mental health profession or religious leader to get help
addressing the problem.
Of course, that isn't what you'll see in most documentation. Instead of
using "source" most people are lazy and use the shorter ".", or in other
words: ". /root/.bash_profile". I wish they wouldn't, if you're not
familiar with the dot command, it's easier to miss that tiny little
period.
--
Stuart Jansen e-mail/jabber: sjansen at buscaluz.org
google talk: stuart.jansen at gmail.com
"However beautiful the strategy, you should occasionally look at
the results." -- Winston Churchill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://sllug.org/pipermail/sllug-members/attachments/20061212/05c2eb54/attachment.pgp
More information about the sllug-members
mailing list