From df752784c26154df83d17f4848823e2112e6a4be Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 3 May 2020 17:44:21 +0200 Subject: [PATCH] examples: beware of portability issues with cmp As someone wrote nearly 20 years ago in Autoconf's documentation, don't use cmp to compare text files, but diff. https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=abad4f0576a7dc361e5385e19c7681449103cdb1 Reported by Jannick. * examples/test: Use diff, not cmp. --- examples/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/test b/examples/test index a1242e3a..02e59b3f 100755 --- a/examples/test +++ b/examples/test @@ -115,7 +115,7 @@ run () } >eff if test $sta_eff -eq $sta_exp; then - if cmp eff exp 2>/dev/null; then + if diff eff exp >/dev/null 2>&1; then echo "$me: PASS: $number" else echo "$me: FAIL: $number"