Problem with mutt version.sh script

Vincent Lefevre vincent at vinc17.org
Thu Apr 26 08:42:11 UTC 2018


On 2018-04-23 14:25:29 -0500, Derek Martin wrote:
> [Then again, I made the same arguments about binutils removing the
> -[number] option to head and tail, and the maintainers went ahead and
> did it anyway. Of course, they finally realized their mistake, and PUT
> IT BACK IN.]

This is different: there was no good reason to remove -[number]
(it's rather clean, contrary to test's -o). And it is also very
useful in interactive use as this is a bit shorter (thus faster
to type) than -n [number].

> In general, the only way the compount -o  wouldn't work is if you
> write some syntax where the shell can't disambiguate the binary
> operator from the unary operator.  It's actually somewhat hard to do
> this unintentionally,

No, not hard: it suffices that the pathname be arbitrary, e.g. an
argument provided by the user (who may not be the author and owner of
this script) or some existing pathname (e.g. created by a malicious
user).

> and easy to avoid...  The primary way this would
> happen is if you didn't quote a shell variable which was empty, though
> that will often also cause other related syntax errors.  There are
> probably other ways.  All of them can be avoided if you use parens to
> group your expressions (but you have to be careful to quote the parens
> properly).

But almost no-ones use parens.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Mutt-dev mailing list