Hi,
On Mandrake 7.0 when you do a su - <user> -c "command" from the root
account,
<user>'s profile is not loaded. When you just do a su - <user>, it works OK.
This is very annoying, I need to create a script that runs as root and
executes some
commands as another user. I can't get this to work right now.
Even su - <user> -c ". .profile; echo $ORACLE_HOME" doesn't work.
How can I get this fixed ? I can't remember having this problem on Red Hat
or SuSE.
I upgraded to the newest sh-utils, but that didn't help either.
Also, su doesn't return the correct errorcode if you use the -c flag, it
always returns 0.
This works fine on e.g. HP/UX and Sun Solaris.
Thanks for the help,
Jasper