=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/su/su.1,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/su/su.1 1996/06/26 05:39:34 1.3 +++ src/usr.bin/su/su.1 1996/10/12 20:40:38 1.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: su.1,v 1.3 1996/06/26 05:39:34 deraadt Exp $ +.\" $OpenBSD: su.1,v 1.4 1996/10/12 20:40:38 millert Exp $ .\" Copyright (c) 1988, 1990 The Regents of the University of California. .\" All rights reserved. .\" @@ -57,7 +57,7 @@ .Nm Su will resort to the local password file to find the password for .Ar login -if there is a Kerberos error. +if there is a Kerberos error or if Kerberos is not installed. If .Nm su is executed by root, no password is requested and a shell @@ -112,7 +112,7 @@ is set to the target login. .Ev PATH is set to -.Dq Pa /bin:/usr/bin . +.Dq Pa /usr/bin:/bin . .Ev TERM is imported from your current environment. The invoked shell is the target login's, and @@ -136,6 +136,17 @@ .Fl m options are mutually exclusive; the last one specified overrides any previous ones. +.Pp +If the optional +.Ar "shell arguments" +are provided on the command line, they are passed to the login shell of +the target login. This allows it to pass arbitrary commands via +the +.Fl c +option as understood by most shells. Note that +.Fl c +usually expects a single argument only; you have to quote it when +passing multiple words. .Pp If group 0 (normally .Dq wheel ) @@ -152,6 +163,23 @@ prompt is set to .Dq Sy \&# to remind one of its awesome power. +.Sh EXAMPLES +.Bl -tag -width 5n -compact +.It Li "su bin -c makewhatis" +Runs the command +.Li makewhatis +as user +.Li bin . +You will be asked for bin's password unless your real UID is 0. +.Pp +.It Li "su bin -c 'makewhatis /usr/local/man'" +Same as above, but the target command consists of more than a +single word. +.Pp +.It Li "su -l foo" +Pretend a login for user +.Li foo . +.El .Sh SEE ALSO .Xr csh 1 , .Xr login 1 ,