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


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sergiu Bordei <sergiu.bordei <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: xargs arguments are not passed to grep
Date: Fri, 15 Sep 2017 11:47:46 +0200
[Message part 1 (text/plain, inline)]
Hello,

please find an error detected when is used a combination of "xargs" and
"grep", arguments {} are not substituted in grep construction:
expected results:
echo "inga"|grep -c "i"
1
user <at> box1:~$ a="i"; echo `echo "inga"|grep -c $a`
1

but was necessary tu use it in combination with xargs:

user <at> box1:~$ echo "i" | xargs -I{} echo $(echo {} ;a=$(echo {}) ; echo $a ;
echo "inga"|grep -c $a)
i i 0
user <at> box1:~$ echo "i" | xargs -I{} echo $(echo {} ;a=`echo {}` ; echo $a ;
echo "inga"|grep -c $a)
i i 0
user <at> box1:~$ echo "i" | xargs -I{} echo $(echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a)
i i 0
user <at> box1:~$ echo "i" | xargs  -I{} echo `echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a`
i i 0
user <at> box1:~$ echo "i" | xargs -I{} echo `echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a`
i i 0
user <at> box1:~$ echo "i" | xargs -I{} echo `echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a`
i i 0



Thanks,
Sergiu Bordei
[Message part 2 (text/html, inline)]

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.