Subject: Re: bug#28469: xargs arguments are not passed to grep

From: Paul Jackson <[email-masked]>
Date: Fri, 15 Sep 2017 11:34:26 -0500

Sergiu wrote:
>> please find an error detected when is used a combination of "xargs" and
>> "grep", arguments {} are not substituted in grep construction:

I believe that all your examples, both expected (count of "1" resulting)
and apparently unexpected (outputs of "i i 0") are working as expected.

I am guessing (am I right?) that you were expecting outputs of "i i 1"
or some such from your last six more complex examples using xargs,
however that "echo inga | grep -c $a" is working on an $a value that
is still inside the $( ... ) or ` ... ` command substitution, and thus equal
to '{}', with $a not yet set to "i" by the final execution of the xargs
invocation of the output from that command substitution.

-- 
                Paul Jackson
                [email-masked]