Joel E. Denny wrote: > On Wed, 5 Aug 2009, Eric Blake wrote: > >> > +if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; >> > then >> > + compare() { diff -u "$@"; } >> >> 'diff -u' is required by POSIX 2008. Rather than filtering on >> whether 'diff --version' includes GNU, it would be better to >> filter on whether 'diff -u' is accepted on the command line, >> to allow other POSIX-compliant implementations their chance. >> Something like 'diff -u /dev/null /dev/null' giving no output >> and having a 0 status should be a sufficient filter. > > Thanks. Here's a revised version. > >>From 9df97231a6824ab608751e61b05c36279719a21a Mon Sep 17 00:00:00 2001 > From: Joel E. Denny <jde...@clemson.edu> > Date: Wed, 5 Aug 2009 10:03:10 -0400 > Subject: [PATCH] update-copyright-tests: improve portability > > * tests/test-update-copyright.sh: Use cmp if diff cannot handle > -u or /dev/null. Suggested by Jim Meyering and Eric Blake.
Thanks. Applied.