bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28469: xargs arguments are not passed to grep


From: Sergiu Bordei
Subject: bug#28469: xargs arguments are not passed to grep
Date: Fri, 15 Sep 2017 11:47:46 +0200

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
address@hidden:~$ a="i"; echo `echo "inga"|grep -c $a`
1

but was necessary tu use it in combination with xargs:

address@hidden:~$ echo "i" | xargs -I{} echo $(echo {} ;a=$(echo {}) ; echo $a ;
echo "inga"|grep -c $a)
i i 0
address@hidden:~$ echo "i" | xargs -I{} echo $(echo {} ;a=`echo {}` ; echo $a ;
echo "inga"|grep -c $a)
i i 0
address@hidden:~$ echo "i" | xargs -I{} echo $(echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a)
i i 0
address@hidden:~$ echo "i" | xargs  -I{} echo `echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a`
i i 0
address@hidden:~$ echo "i" | xargs -I{} echo `echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a`
i i 0
address@hidden:~$ echo "i" | xargs -I{} echo `echo {} ;a={} ; echo $a ; echo
"inga"|grep -c $a`
i i 0



Thanks,
Sergiu Bordei


reply via email to

[Prev in Thread] Current Thread [Next in Thread]