DASH Shell discussions
 help / color / mirror / Atom feed
From: Guido Berhoerster <guido+kernel.org@berhoerster.name>
To: "David A. Wheeler" <dwheeler@dwheeler.com>
Cc: dash@vger.kernel.org, jrnieder@gmail.com
Subject: Re: [PATCH] Allow == as synonym for = in test
Date: Mon, 7 Mar 2011 11:34:57 +0100	[thread overview]
Message-ID: <20110307103457.GA5987@wopr.local.invalid> (raw)
In-Reply-To: <E1PwOzt-0007C2-Qw@fenris.runbox.com>

* David A. Wheeler <dwheeler@dwheeler.com> [2011-03-07 02:12]:
> Jonathan Nieder:
> > Has the Austin Group made a decision
> > on whether this syntax is going to be supported?
> 
> I don't think a decision has been formally made.  Most of the email discussion has been about possibly adding "<" and ">" to the spec, which are not in the current POSIX spec but are already implemented in dash.  The last comment posted on mantis about this extension to POSIX was positive; eblake (manager) said, "adding the other four operators (==, -ot, -nt, -ef) make[s] sense" [http://austingroupbugs.net/view.php?id=375].
> 
> > dash tends to support features that ash and older
> > versions of dash supported (to avoid breaking backward compatibility)
> 
> Busybox's ash *already* supports "==", so I think that's *also* an argument for adding "==".  After all, adding "==" would improve compatibility between busybox ash and dash, and its effect on space and speed is miniscule.  I understand that dash wants to be "lean and mean", but busybox does too, and even busybox supports "==". 
> 
> I think it's reasonably likely that "==" will be added to the POSIX spec, but that's not up to me.  Even if this syntax isn't added to the official standard, I still think it'd make sense to support "==".  It's already implemented in a number of shells, including bash, busybox ash, and ksh.  More importantly, a lot of extant shell scripts use it; many scripts won't work on dash because dash doesn't include "==".

By that argument pretty much every (mis)feature of bash can be
included into dash because people keep writing scripts assuming
/bin/sh == bash which of course will not work on dash.
I consider dash's orientation towards POSIX/SUS compliance and
lack of support for many extensions a feature, it makes it easy
to extend with later POSIX features without breaking backwards
compatibility and allows one to easily spot bashisms in /bin/sh
scripts. Hence I don't think it is a good idea to add this to
dash before it is being standardized.
BTW, dash's test builtin already supports the -ot, -nt, and -ef
operators, unfortunately -ot and -nt behavior differs from all
other implementations [1].

[1] http://www.mail-archive.com/dash@vger.kernel.org/msg00206.html
-- 
Guido Berhoerster

  reply	other threads:[~2011-03-07 10:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-06 23:01 [PATCH] Allow == as synonym for = in test David A. Wheeler
2011-03-06 23:48 ` Jonathan Nieder
2011-03-07  1:12   ` David A. Wheeler
2011-03-07 10:34     ` Guido Berhoerster [this message]
2011-03-07 14:55       ` David A. Wheeler
2011-03-07 17:18         ` Guido Berhoerster
2011-03-07 17:37           ` Dan Muresan
2011-03-07 22:00         ` Jonathan Nieder
2011-03-07 23:03           ` David A. Wheeler
2011-03-08  0:05             ` Guido Berhoerster
2011-03-08  0:03               ` Eric Blake
2011-03-08  7:17               ` Dan Muresan
2011-03-08 15:27                 ` Paul Smith
2011-03-08 15:53                   ` Dan Muresan
2011-03-08 18:13                 ` Guido Berhoerster
2011-03-08 18:43                   ` Dan Muresan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110307103457.GA5987@wopr.local.invalid \
    --to=guido+kernel.org@berhoerster.name \
    --cc=dash@vger.kernel.org \
    --cc=dwheeler@dwheeler.com \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox