Sujet : Re: Take that, Microsoft!
De : candycanearter07 (at) *nospam* candycanearter07.nomail.afraid (candycanearter07)
Groupes : comp.os.linux.advocacyDate : 27. May 2024, 03:55:02
Autres entêtes
Organisation : the-candyden-of-code
Message-ID : <slrnv57ppr.pvf.candycanearter07@candydeb.host.invalid>
References : 1 2 3 4 5 6 7
User-Agent : slrn/1.0.3 (Linux)
Sebastian Wells <
sebastian@here.com.invalid> wrote at 06:46 this Saturday (GMT):
On Fri, 24 May 2024 17:35:09 -0000 (UTC), candycanearter07 wrote:
>
Chris Ahlstrom <OFeem1987@teleworm.us> wrote at 12:39 this Friday (GMT):
But both can be used by other shells. The files /usr/bin/test and
/usr/bin/[ are different sizes, but doing "man \[" brings up test(1).
Good to know, I suppose.
>
That made me curious enough to dig. On MacOS, /bin/[ and /bin/test are
hardlinked together.
>
"dpkg-query" says that both [ and test are provided by coreutils, but
coreutils has a src/test.c, and src/lbracket.c for the other program.
src/lbracket.c is very simple:
>
#define LBRACKET 1 #include "test.c"
>
The reason for the difference seems to be that GNU wanted to have --help
and --version options, but POSIX only allows [ to print anything in
response to those options, while "test" has to exit silently.
>
MacOS also handles these arguments differently depending on if it's
/bin/[ or /bin/test, with [ printing an error message (and no help)
instead of returning silently.
Interesting.
-- user <candycane> is generated from /dev/urandom
Date | Sujet | # | | Auteur |
22 May 24 | Take that, Microsoft! | 13 | | DFS |
22 May 24 | Re: Take that, Microsoft! | 12 | | Andrzej Matuch |
23 May 24 | Re: Take that, Microsoft! | 3 | | RonB |
23 May 24 | Re: Take that, Microsoft! | 1 | | vallor |
23 May 24 | Re: Take that, Microsoft! | 1 | | Andrzej Matuch |
23 May 24 | Re: Take that, Microsoft! | 6 | | Chris Ahlstrom |
24 May 24 | Re: Take that, Microsoft! | 5 | | candycanearter07 |
24 May 24 | Re: Take that, Microsoft! | 4 | | Chris Ahlstrom |
24 May 24 | Re: Take that, Microsoft! | 3 | | candycanearter07 |
25 May 24 | Re: Take that, Microsoft! | 2 | | Sebastian Wells |
27 May 24 | Re: Take that, Microsoft! | 1 | | candycanearter07 |
23 May 24 | Re: Take that, Microsoft! | 2 | | DFS |
23 May 24 | I, for one, welcome our new overlords. | 1 | | Relf |