[comp.unix] Question on su -c option

peter@aucs.UUCP (Peter Steele) (07/04/90)

  su - -c fred ls

is supposed to login to account fred, execute ls, and then logout. This
appears to work except that .login and .cshrc do not appear to be executed
(nor .profile for that matter). I have oracle installed here and have to
give a command in a startup script that looks like

  su - -c oracle tcpctl start

but it doesn't work because there are a number of environment variables
that are not set properly and so the tcpctl start command fails. I can
get it to almost work using

  echo 'tcpctl start' | su - oracle

The only problem this seems to cause is that the stty command in .login
reports the error 'not a character device', but otherwise the login works
okay. Does anyone know the proper way to do what I want? Thanks!
-- 
Peter Steele, Microcomputer Applications Analyst
Acadia University, Wolfville, NS, Canada B0P1X0 (902)542-2201x121
UUCP: {uunet|watmath|utai|garfield}!cs.dal.ca!aucs!Peter
BITNET: Peter@Acadia  Internet: Peter@AcadiaU.CA

peter@aucs.UUCP (Peter Steele) (07/04/90)

According to the man entry on su, a command such as

  su - -c fred ls

is supposed to login to account fred, execute ls, and then logout. This
appears to work except that .login and .cshrc do not appear to be executed
(nor .profile for that matter). I have oracle installed here and have to
give a command in a startup script that looks like

  su - -c oracle tcpctl start

but it doesn't work because there are a number of environment variables
that are not set properly and so the tcpctl start command fails. I can
get it to almost work using

  echo 'tcpctl start' | su - oracle

The only problem this seems to cause is that the stty command in .login
reports the error 'not a character device', but otherwise the login works
okay. Does anyone know the proper way to do what I want? Thanks!
-- 
Peter Steele, Microcomputer Applications Analyst
Acadia University, Wolfville, NS, Canada B0P1X0 (902)542-2201x121
UUCP: {uunet|watmath|utai|garfield}!cs.dal.ca!aucs!Peter
BITNET: Peter@Acadia  Internet: Peter@AcadiaU.CA