On Tue, Nov 27, 2018 at 07:40:24PM +0100, Bruno Haible wrote: > Roman Bolshakov wrote: > > if test -n "$$files"; then > > \ > > if test -n "$$prohibit"; then \ > > - grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \ > > + echo "$$files" | xargs -n $(VC_ARG_MAX) > > \ > > + grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" \ > > | grep -vE "$${exclude:-^$$}" > > \ > > && { msg="$$halt" $(_sc_say_and_exit) } || :; > > \ > > It is incorrect to transform > > grep OPTIONS FILES > > to > > echo FILES | xargs -n N grep OPTIONS > > because when the last chunk of FILES consists of just 1 file, 'grep' > produces different output. Instead, you need to transform it to > > echo FILES | xargs -n N grep OPTIONS /dev/null > > See: > > $ cd gnulib/modules > > $ grep xalloc *-tests > acl-tests:xalloc > copy-file-tests:xalloc > c-xvasprintf-tests:xalloc > obstack-printf-tests:xalloc > regex-quote-tests:xalloc > userspec-tests:xalloc > xalloc-die-tests:tests/test-xalloc-die.c > xalloc-die-tests:tests/test-xalloc-die.sh > xalloc-die-tests:TESTS += test-xalloc-die.sh > xalloc-die-tests:check_PROGRAMS += test-xalloc-die > xalloc-die-tests:test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ > > $ echo *-tests | xargs -n 1 grep xalloc > xalloc > xalloc > xalloc > xalloc > xalloc > xalloc > tests/test-xalloc-die.c > tests/test-xalloc-die.sh > TESTS += test-xalloc-die.sh > check_PROGRAMS += test-xalloc-die > test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ > > $ echo *-tests | xargs -n 1 grep xalloc /dev/null > acl-tests:xalloc > copy-file-tests:xalloc > c-xvasprintf-tests:xalloc > obstack-printf-tests:xalloc > regex-quote-tests:xalloc > userspec-tests:xalloc > xalloc-die-tests:tests/test-xalloc-die.c > xalloc-die-tests:tests/test-xalloc-die.sh > xalloc-die-tests:TESTS += test-xalloc-die.sh > xalloc-die-tests:check_PROGRAMS += test-xalloc-die > xalloc-die-tests:test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ > > Bruno >
Understood, I will add /dev/null as an extra argument. Thank you, Roman