Submitted 24-Jun-00 by Jasper Spit:

> This doesn't work for me. I just don't understand why su doesn't load
> the user's profile. What's the point of the -c option if it doesn't load
> the profile with the correct PATH settings, etc. ?!?

The point of -c is to set the euid of the process, that is all :)
Anything that is dependent on a particular user's base environment
should be specified as opposed to expecting that environment.

For example, root's path does not include /usr/local/bin or ~user/bin.
If I want to run a program from one of those locations as a user via
su in a script, I use su -c "~user/bin/program"

You *shouldn't* require access to a specific user's environment for
administrative functions, which is all the root account is meant for.
Set those environment variables you need within the script.  This will
prevent them from being exported into root's master environment.

-- 
       _
     _|_|_
      ( )   *    Anton Graham
      /v\  /     <[EMAIL PROTECTED]>
    /(   )X
     (m_m)       GPG ID: 18F78541
Penguin Powered!

Reply via email to