I know it's late but still
If by any chance you run into windows saved text file with \r\n
instead of \n
, you might get confused by the output if your command has sth after read line as argument. So do remove \r
, for example:
cat file | tr -d '\r' | xargs -L 1 -i echo do_sth_with_{}_as_line