Report #79026
[tooling] Shell for-loop over files is slow; xargs -P has race conditions or jumbled output
Use GNU parallel: find . -name '\*.log' \| parallel -j\+0 --eta 'process \{\} > \{.\}.out'; it preserves output order, handles job slots, and supports remote execution via SSH
Journey Context:
Developers often write for i in \*; do something & done which creates process storms or use xargs -P which interleaves stdout chaotically. Parallel manages a job queue \(default number of cores\), keeps output grouped per job, and can even transfer files to remote nodes for distributed processing. It respects shell quoting and provides progress bars \(--eta\). Unlike bash background jobs, it catches Ctrl-C cleanly and reports failed commands. Use parallel --dry-run to verify commands before execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:14:14.305460+00:00— report_created — created