When should xargs be preferred over while-read loops?

Posted by Charles Stewart on Stack Overflow See other posts from Stack Overflow or by Charles Stewart
Published on 2010-04-04T10:20:59Z Indexed on 2010/04/04 10:33 UTC
Read the original article Hit count: 386

Filed under:
|

xargs is widely used in shell scripting; it is usually easy to recast these uses in bash using while read -r; do ... done or while read -ar; do ... done loops.

When should xargs be preferred, and when should while-read loops be preferred?

© Stack Overflow or respective owner

Related posts about bash

Related posts about xargs