is a combination of
split. It takes a bunch of lines,
and sends them to a number of child processes. Each process sees
only one of the lines.
seq 16 | xlines -c 'cat > $(mktemp)'
...will give you 8 temporary files (on an 8-core machine) containing:
Why would you care?
You have a bunch of
INSERT statements coming off a stream, but your
database will only use a single core if you run them in series:
zcat sql.gz | xlines -P 32 -- psql
zcat sql.gz | xlines -P 32 -c 'buffer | psql'
A specific tool to fix a specific job. I still don't think it makes up for the lack of limited parallelism in shell, however. Still thinking about that one...