Bash script as root problem
Nils Kassube
kassube at gmx.net
Sun Mar 17 12:36:50 UTC 2013
Gene Heskett wrote:
> On Sunday 17 March 2013 07:47:49 Colin Law did opine:
> > On 17 March 2013 00:19, Gene Heskett <gheskett at wdtv.com> wrote:
> > > On Saturday 16 March 2013 20:18:40 Bill K. Dengler did opine:
> > >> su -c "command_7" $USER
> > > Wrong syntax Bill, its
> > > su user -c "command_7"
> > man su says
> > su [options] [username]
> Go ahead. Try it Colin, I'll wait. ;)
>
> BTDT, the man page is incomplete and has been so for nearly 15 years.
I'm not Colin, but this is what I get:
# echo $USER
root
# su nils -c 'echo $USER'
nils
# su -c 'echo $USER' nils
nils
> Now, if we could just get someone to actually fix the %@$#&@( man page
> so we don't have this argument everytime someone wants run su, not to
> get root, but to get another user from root. There is a difference.
Hmm, if you have this argument for 15 years I would expect that someone
told you already that both versions work equally well. :)
Nils
More information about the ubuntu-users
mailing list