Reputation: 762
The statement below should print afc abc
but it prints abc abc
instead
I tried many times but every time same result
Don't know why this happens could anyone explain and help me?
echo abc|xargs -i{} echo $(echo {}|sed 's/b/f/g') {}
Upvotes: 1
Views: 76
Reputation: 69
You should use as sh -c
in xargs like:
echo abc|xargs -i{} sh -c "echo {}|sed 's/b/f/g'"
Upvotes: 1