bash xargs: same command gives different output

خرید بک لینک

When I run

ls -1 *.a | xargs -I{} echo {} | sed 's/.a//'

The output is

1
2
3

When I run

ls -1 *.a | xargs -I{} bash -c "echo {} $(echo {} | sed 's/.a//')"

and the output is

1.a 1.a
2.a 2.a
3.a 3.a

What is the reason for this anomaly?

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 242 تاريخ: شنبه 5 تير 1395 ساعت: 0:47

صفحه بندی