Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!apple!bionet!ig!agate!ucbvax!decwrl!labrea!csli!gandalf From: gandalf@csli.STANFORD.EDU (Juergen Wagner) Newsgroups: comp.unix.questions Subject: Re: Summary of Responses Message-ID: <5390@csli.STANFORD.EDU> Date: 6 Sep 88 00:33:30 GMT References: <663@neptune.AMD.COM> <48200005@hcx3> <6246@rpp386.Dallas.TX.US> Reply-To: gandalf@csli.UUCP (Juergen Wagner) Organization: Center for the Study of Language and Information, Stanford U. Lines: 53 >In article <48200005@hcx3> shirono@hcx3.SSD.HARRIS.COM writes: >>In comp.unix.questions <1000 Aug 31, 1988>, leightsu@neptune.UUCP writes: >>> It is not documented in the Ultrix and BSD4.3 doc sets that I have in >>> my possession. Am I missing something? >> >>Yes. -c is not an option to su. It is an option to sh, csh, ksh (and >>I believe tcsh, as well). In article <6246@rpp386.Dallas.TX.US> jfh@rpp386.Dallas.TX.US (The Beach Bum) writes: >... >the -c may not be an option to su, but it works quite nicely, thank you. > [script deleted] > >what most likely is happening is that -c is being passed to the shell >as the command and the command is being passed as the argument, which >the shell then interprets as a command. so, in the end everything works >just fine. Well, the manual for SunOS 4.0 (3.5 is the same) says: ... su [ - ] [ -f ] [ -c command ] [ username ] ... -c command Execute command after logging in as the new user. ... Ultrix (T2.2-4A System #5) just has: su [ userid ] Ok, next I tried HP-UX (HP-UX 6.0 and 5.x): su [ - ] [ name [ arg ... ] ] and further down in the man page, it says: Any additional arguments given on the command line are passed to the program invoked as the shell, permitting the super-user to run shell procedures with restricted privileges. When using programs like sh(1), an arg of the form -c string executes string via the shell and an arg of -r will give the user a restricted shell. 4.2 BSD UNIX seems to have the -c option, too. So far with the poll. I guess, one shouldn't rely on having it when working under non-BSD systems (HP-UX, Ultrix). -- Juergen "Gandalf" Wagner, gandalf@csli.stanford.edu Center for the Study of Language and Information (CSLI), Stanford CA