[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test -t FD vs. [FD]
From: |
Jim Meyering |
Subject: |
Re: test -t FD vs. [FD] |
Date: |
Sun, 06 Jul 2003 08:14:52 +0200 |
Paul Eggert <address@hidden> wrote:
> address@hidden (Paul Jarc) writes:
>
>> Paul Eggert <address@hidden> wrote:
>> > POSIX long ago decided that FD is not optional with test -t. GNU
>> > 'test' conforms to POSIX in this respect.
>>
>> bash's does, but coreutils' doesn't.
>
> Good point. I looked at coreutils/src/test.c and noticed some other
> incompatibilities with POSIX and with the GNU coding standards. Here
> is a patch to fix them. Even with this patch, coreutils "test"
> disagrees with Bash "test" on some cases but that is a subject for a
> different email.
>
> 2003-06-30 Paul Eggert <address@hidden>
>
> Add support for a "[" that conforms to the GNU coding standards,
> i.e., that does not depend on its name.
> * src/lbracket.c: New file.
> * README: Add "[".
> * man/Makefile.am (programs): Ignore "[", since it doesn't have
> a separate man page.
> * src/Makefile.am (bin_PROGRAMS): Add "[".
> (__SOURCES): New var.
> * src/test.c (LBRACKET): Define to 0 if not defined.
> (main): Use LBRACKET rather than argv[0].
>
> * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
>
> * src/test.c (main): Do not recognize --help or --version if
> POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
> Do not bother testing that margv[margc] is non-null.
Thank you!
I've applied that patch.