slifer2015
slifer2015

Reputation: 762

why pipe and sed print with args akward statement?

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

Answers (1)

vahit
vahit

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

Related Questions