groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/24: HACKING: Correct my bad advice regarding `wc`.


From: G. Branden Robinson
Subject: [groff] 05/24: HACKING: Correct my bad advice regarding `wc`.
Date: Mon, 2 Dec 2024 22:52:27 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 4caf7049857cfc02bad984da46ab4d02c30f8b29
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Nov 30 17:42:20 2024 -0600

    HACKING: Correct my bad advice regarding `wc`.
---
 HACKING | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/HACKING b/HACKING
index 97f08eaba..49a815884 100644
--- a/HACKING
+++ b/HACKING
@@ -160,11 +160,12 @@ Here are some portability notes on writing automated 
tests.
   Here is a workaround.
 
   res=$(whatever | wc -l)
-  res=$(expr "$res" + 0) || exit 99
+  res=$(( res + 0 )) || exit 99
 
-  "expr"'s output is more rigidly specified, and if for some reason we
-  get unacceptable non-integer garbage from "wc", we exit the test
-  script with the code reserved for "hard errors".
+  If for some reason we get unacceptable non-integer garbage from "wc",
+  we exit the test script with the code reserved for "hard errors".
+  Shell arithmetic is unfortunately one of the many POSIX shell features
+  that Solaris 10's /bin/sh does not implement; see the "PROBLEMS" file.
 
 * The "od" command on macOS can put extra space characters (i.e., spaces
   that don't correspond to the input) at the ends of lines when using



reply via email to

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