Why do all the sudo? [was Re: Software updater no longer functional]

Colin Watson cjwatson at ubuntu.com
Fri Jan 27 13:59:05 UTC 2017


On Fri, Jan 27, 2017 at 02:19:58PM +0100, Ralf Mardorf wrote:
> Yes, sudo has got a benefit, especially in combination with the
> timestamp, e.g. for scripts, that compile something without root
> privileges and after that install something, that requires root
> privileges.

As a side note, sudo is also superior to su in shell command design
terms, because if it's being used in an adverbial style (i.e. "run this
command with these arguments as another user") then it doesn't require
the subsidiary command and arguments to be quoted and passed as a single
argument.  Shell quoting is complicated and error-prone, so it's always
better where possible for adverbial commands to be written in a style
that doesn't require an extra layer of quoting.

Since su has been around for such a long time, I suspect that it may
predate a general understanding of this class of problem (though I don't
know this for sure, as both su and sudo predate me by quite a while).

-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the ubuntu-users mailing list