GNU bug report logs - #28469
xargs arguments are not passed to grep

Previous Next

Package: grep;

Reported by: Sergiu Bordei <sergiu.bordei <at> gmail.com>

Date: Fri, 15 Sep 2017 15:39:02 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Jackson <pj <at> usa.net>
To: 28469 <at> debbugs.gnu.org, sergiu.bordei <at> gmail.com
Subject: bug#28469: xargs arguments are not passed to grep
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
                pj <at> usa.net




This bug report was last modified 5 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.