View Single Post
  #2   (View Single Post)  
Old 7th September 2010
rocket357's Avatar
rocket357 rocket357 is offline
Real Name: Jonathon
Wannabe OpenBSD porter
Join Date: Jun 2010
Posts: 429

Originally Posted by sputnik View Post
Anyone has a clue? If i use "su - root", i have all aliases in /root/.profile working. If i use "su", /root/.profile doesn't seem to be read by ksh. What's the solution? Typing "su - root" every time is annoying.
That's intended behavior. If you simply "su", you're keeping your environment while gaining elevated priv. If you "su -", you are using a login shell to read root's environment.

Read ksh's manpage (search for login shell and privileged shell).
Reply With Quote