On Wed, 6 Apr 2016 11:58:11 -0600 Eric Blake <[email protected]> wrote:
> On 04/06/2016 11:09 AM, [email protected] wrote: > > From: Mattias Andrée <[email protected]> > > > > --- > > doc/coreutils.texi | 7 ++++++- > > src/test.c | 44 > > +++++++++++++++++++++++++++++++++++++++++++- 2 files > > changed, 49 insertions(+), 2 deletions(-) > > > Thanks for the patch, and remembering to document it. > However, it also needs a NEWS entry and testsuite > coverage; by the time you do that, the patch may be > non-trivial enough to need copyright assignment. Will do. Copyright assignment request has already been send. > > Also, the bar for adding new options to 'test' is very > high - is there any other existing practice (say in bash, > ksh, zsh, BSD, or elsewhere) that is already using -E, > and if so, are they using it for the same purpose? If > so, mention it and this patch is worthwhile; if not, I'm > a bit reluctant to be the first inventor, especially if > something else more portable can be used. I have not looked at all shells, but for non-builtin implementations it seems like -E is free on all implementations and that there is no equivalent. I have submitted this addition too to sbase, but it is pending. The rationale for this flag that it is better to implement it in test than as a separate command. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=385069 > > On the other hand, I readily concur that "test -s > directory" does NOT accurately report whether the > directory has contents, so maybe adding the new operator > has justification on that grounds; it would also be nice > if you could simultaneously propose it on the bash > mailing list, so that multiple GNU programs implement the > same semantics at once. > I was think about proposing Bash add it, or simply remove the builtin test command completely. Bash's test and coreutils's test are not fully compatible (Bash does not support big integers, and have a bug [have not reported it yet] where it fails follow POSIX's rules of how to parse the expression,) and I don't see the use of having test built in, but perhaps they do. And if there really is a need for a builtin, just embed coreutil's implementation.
pgpavaL2qyzLj.pgp
Description: OpenPGP digital signature
