automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: doc: mention shell operators pr


From: Karl Berry
Subject: [automake-commit] branch master updated: doc: mention shell operators preferred over `test` options.
Date: Sat, 18 Nov 2023 21:25:42 -0500

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=f4b5d415eeacfdde9f69e5230d6941e7f91e8670

The following commit(s) were added to refs/heads/master by this push:
     new f4b5d415e doc: mention shell operators preferred over `test` options.
f4b5d415e is described below

commit f4b5d415eeacfdde9f69e5230d6941e7f91e8670
Author: Karl Berry <karl@freefriends.org>
AuthorDate: Sat Nov 18 18:25:16 2023 -0800

    doc: mention shell operators preferred over `test` options.
    
    * doc/automake.texi (Usage of Conditionals): mention that shell
    operators (&&, ||, ()) are preferred over `test` options (-a, -o,
    \(\)). Idea and POSIX url reference from Michael Stapelberg,
    https://lists.gnu.org/archive/html/automake-patches/2016-10/msg00002.html
---
 doc/automake.texi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/automake.texi b/doc/automake.texi
index 51a3c3dbe..635bdd28c 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -11118,6 +11118,14 @@ must arrange for @emph{every} @code{AM_CONDITIONAL} to 
be invoked every
 time @command{configure} is run.  If @code{AM_CONDITIONAL} is run
 conditionally (e.g., in a shell @code{if} statement), then the result
 will confuse @command{automake}.
+
+For portability, it is best to use shell operators @code{&&} and
+@code{||} and parentheses, when constructing a compound
+@var{condition} using the @command{test} command, and not the
+@code{-a} and @code{-o} options and parentheses as options to
+@command{test}, all of which have been marked obsolescent by POSIX
+(@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_161}).
+The name @code{test} is also more portable than @code{[}.
 @end defmac
 
 @cindex @option{--enable-debug}, example



reply via email to

[Prev in Thread] Current Thread [Next in Thread]