On Mon, 28 Feb 2000, Bob Proulx wrote:

> 
> > Dear mantainer,
> 
> Not the maintainer but another list denizen.
> 
> > Running 
> >     su -c echo davide -norc
> > with su (in sh-utils 2.0) under linux I receive the following
> > 
> >     su: invalid option -- n
> >     Try `su --help' for more information.
> > 
> > is this correct?
> > Reading the usage it seemed (to me) that the -norc option went to the
> > shell, instead here it is parsed by getopt.
> 
> The -c option takes a single argument.  Here you have given it more
> than that.  You should quote the -c argument so that it is all
> recieved as one option.
> 
>   su -c 'echo davide -norc'

no, echo is the only argument of the -c option; -norc is a shell argument
for bash; so the parsing I would expect is:
        su
        -c echo         (command)
        davide          (user)
        -norc           (shell args)

> Bob

Thanks,

                        Davide

Reply via email to