🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix
Article #137

Question on su -c option

#137
From: Peter Steele
Date: Wed, 04 Jul 1990 01:13
25 lines
1482 bytes
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
Technical Details
Message-ID: <3670@zorba.Tynan.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!zorba!dtynan

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!zorba!dtynan
From: peter@aucs.UUCP (Peter Steele)
Newsgroups: comp.unix
Subject: Question on su -c option
Message-ID: <3670@zorba.Tynan.COM>
Date: 4 Jul 90 01:13:32 GMT
Sender: dtynan@zorba.Tynan.COM
Reply-To: uunet!aucs!peter (Peter Steele)
Organization: School of Computer Science, Acadia Univ., Nova Scotia
Lines: 25
Approved: dtynan@zorba.Tynan.COM