Re: Take that, Microsoft!

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Take that, Microsoft!
De : sebastian (at) *nospam* here.com.invalid (Sebastian Wells)
Groupes : comp.os.linux.advocacy
Date : 25. May 2024, 08:46:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2s1gt$2okjl$2@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Pan/0.154 (Izium; 517acf4)
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.

Date Sujet#  Auteur
22 May 24 * Take that, Microsoft!13DFS
22 May 24 `* Re: Take that, Microsoft!12Andrzej Matuch
23 May 24  +* Re: Take that, Microsoft!3RonB
23 May 24  i+- Re: Take that, Microsoft!1vallor
23 May 24  i`- Re: Take that, Microsoft!1Andrzej Matuch
23 May 24  +* Re: Take that, Microsoft!6Chris Ahlstrom
24 May 24  i`* Re: Take that, Microsoft!5candycanearter07
24 May 24  i `* Re: Take that, Microsoft!4Chris Ahlstrom
24 May 24  i  `* Re: Take that, Microsoft!3candycanearter07
25 May 24  i   `* Re: Take that, Microsoft!2Sebastian Wells
27 May 24  i    `- Re: Take that, Microsoft!1candycanearter07
23 May 24  `* Re: Take that, Microsoft!2DFS
23 May 24   `- I, for one, welcome our new overlords.1Relf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal