[ic] Gentoo: Different syntax for su command

John Young john_young at sonic.net
Mon Jan 17 16:03:13 EST 2005

Gary Norton wrote:

> You are correct, the "-" is not needed. I do that out of habit. However, 
> if you put the user ID at the end of the command, it does not work. 

Syntax for su on two different Linux and Unix systems here, both a
a couple of years old:

     su [-] [ username  [ arg...]]

     su [OPTION]... [-] [USER [ARG]...]

That says to me that any arguments, such as "-c ...", follow username
specification.  Perhaps allowing arguments before the username is a
sometimes-tolerated-but-deviant behavior.  Maybe someone wanted to
clean up the old code.  The syntax above makes sense to me, since
-/-l are sort-of pre-username, ie, whether or not to do the shell,
and args such as -c or -r are after-the-fact shell argument types-of-things.

-John Young

More information about the interchange-users mailing list