View Single Post
  #8   (View Single Post)  
Old 18th February 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

See the examples in that same manual ..

Code:
EXAMPLES
     su -m man -c catman
            Runs the command catman as user man.  You will be asked for man's
            password unless your real UID is 0.  Note that the -m option is
            required since user ``man'' does not have a valid shell by
            default.
     su -m man -c 'catman /usr/share/man /usr/local/man'
            Same as above, but the target command consists of more than a sin-
            gle word and hence is quoted for use with the -c option being
            passed to the shell.  (Most shells expect the argument to -c to be
            a single word).
And:

Code:
su -m www ps    
/bin/ps: /bin/ps: cannot execute binary file

su -m www -c ps  
  PID  TT  STAT      TIME COMMAND
 1023  p0  R+     0:00.00 ps

Last edited by DutchDaemon; 18th February 2009 at 09:05 PM.
Reply With Quote