From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9163 invoked from network); 11 Oct 2020 00:09:03 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2020 00:09:03 -0000 Received: (qmail 22510 invoked by uid 550); 11 Oct 2020 00:09:01 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 22489 invoked from network); 11 Oct 2020 00:09:00 -0000 Date: Sat, 10 Oct 2020 20:08:48 -0400 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20201011000848.GD17637@brightrain.aerifal.cx> References: <20201010185110.748-1-issam.e.maghni@mailbox.org> <20201010185110.748-2-issam.e.maghni@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201010185110.748-2-issam.e.maghni@mailbox.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH 2/2] configure: improve portability of test command On Sat, Oct 10, 2020 at 06:51:10PM +0000, Issam E. Maghni wrote: > > The two commands: > > test "$1" > > test ! "$1" > > could not be used reliably on some historical systems. Unexpected results > > would occur if such a string expression were used and $1 expanded to '!', '(', > > or a known unary primary. Better constructs are: > > test -n "$1" > > test -z "$1" > > respectively. > > Historical systems have also been unreliable given the common construct: > > test "$response" = "expected string" > > One of the following is a more reliable form: > > test "X$response" = "Xexpected string" > > test "expected string" = "$response" > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 The text you've quoted is about non-conforming, pre-POSIX systems. Is there an actual system where you're encoutering this problem? It's always been the intent to assume a POSIX-conforming shell and utilities for configure, and to require the user to upgrade to one if they don't have one, because supporting non-conforming shell/utilities is an endless game of whack-a-mole. Rich