Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xargs exits on empty line from stdin (#435)
* BSD versions of xargs don't support the -l option * Standards document for xargs mentions -L but not -l [1] * Follow GNU version and accept -l as an alias for -L, but list standard -L in usage string * Behaviour of -L/-l didn't match xargs on my linux system: input loop was terminated on first empty line of STDIN * Skipping empty lines makes the behaviour match GNU version 1. https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/xargs.html %cat -n in # not all lines have content 1 #!/usr/bin/perl 2 3 =begin metadata 4 5 Name: awk 6 Description: pattern-directed scanning and processing language 7 Author: Tom Christiansen, tchrist@perl.com 8 Author: Larry Wall, larry@wall.org 9 License: perl 10 %xargs -L 1 < in # implicit 'echo' for each line of stdin #!/usr/bin/perl =begin metadata Name: awk Description: pattern-directed scanning and processing language Author: Tom Christiansen, tchrist@perl.com Author: Larry Wall, larry@wall.org License: perl %perl xargs -L 1 < in # patched version #!/usr/bin/perl =begin metadata Name: awk Description: pattern-directed scanning and processing language Author: Tom Christiansen, tchrist@perl.com Author: Larry Wall, larry@wall.org License: perl
- Loading branch information