su - <user> doesn't read <user_home>/.profile

From: Husemann, Harald (harald.husemann@Materna.DE)
Date: Thu Mar 13 2003 - 04:24:36 EST


Managers,

I have a little problem:

I'm using the following command inside a script to execute a command with
another user's right:

su - <user> -c "<command>".

The manpage says that with "su -" su should read the user's .profile, but it
seems it doesn't - I even tried the following:

su - <user> -c ". ~/.profile; <command>".

But, that also didn't work, the profile is read (saw that with a truss), but
e. g. the $PATH-variable isn't changed.
(Just used echo $PATH and examined the output).

Any ideas what's wrong here??

User's Shell is set to /bin/bash, and I also tried it with ~/.bash_profile,
without success.

Thanks for your help,

keep on hackin',

Harald

============================================
Harald Husemann
Systems Engineer
Teammanager Unix administration and Configuration Management
Materna Gmbh - Vo_kuhle 37 -
D-44141 Dortmund, Germany
Phone: +49-231-5599-8684
Mobile: +49-179-2300651
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:58 EDT