From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1262970-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D315813835A for <garchives@archives.gentoo.org>; Sun, 21 Mar 2021 05:48:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9E267E08EB; Sun, 21 Mar 2021 05:48:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4F0EFE089A for <gentoo-commits@lists.gentoo.org>; Sun, 21 Mar 2021 05:48:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F1C8733BE0A for <gentoo-commits@lists.gentoo.org>; Sun, 21 Mar 2021 05:48:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 62EA44EE for <gentoo-commits@lists.gentoo.org>; Sun, 21 Mar 2021 05:48:11 +0000 (UTC) From: "Ulrich Müller" <ulm@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org> Message-ID: <1616305661.04d0b38c276a5eb47c7d9485a97dfd73ab5cbff4.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: tools-reference/bash/ X-VCS-Repository: proj/devmanual X-VCS-Files: tools-reference/bash/text.xml X-VCS-Directories: tools-reference/bash/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 04d0b38c276a5eb47c7d9485a97dfd73ab5cbff4 X-VCS-Branch: master Date: Sun, 21 Mar 2021 05:48:11 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 65925129-db30-45ce-bd6a-8537073e31c2 X-Archives-Hash: 9fe24747ad13c43dae618034fe536351 commit: 04d0b38c276a5eb47c7d9485a97dfd73ab5cbff4 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Mar 12 21:06:45 2021 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Sun Mar 21 05:47:41 2021 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=04d0b38c tools-reference/bash: elaborate on why bash tests are preferred Signed-off-by: Sam James <sam <AT> gentoo.org> Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> tools-reference/bash/text.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools-reference/bash/text.xml b/tools-reference/bash/text.xml index 56608c4..821d385 100644 --- a/tools-reference/bash/text.xml +++ b/tools-reference/bash/text.xml @@ -119,6 +119,14 @@ The <c>[[ ]]</c> form is generally safer than <c>[ ]</c> and should be used in all new code. </important> +<p> +POSIX compliance is not a concern for ebuilds, as their interpreter is +guaranteed to be GNU Bash. POSIX style tests have different semantics and +using the common forms of tests adheres to the principle of least surprise. +Most developers will be used to Bash test semantics and behaviour and deviating +from this in ebuilds may be confusing. +</p> + <p> This is because <c>[[ ]]</c> is a bash syntax construct, whereas <c>[ ]</c> is a program which happens to be implemented as an internal <d/> as such, cleaner