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