I wrote an bash enumerator because I was sick of xargs
A small Bash utility that unifies iterating over files and lists with a `{}` placeholder is met with skepticism from command‑line users who argue that `find -print0`, `xargs -0`, GNU Parallel and simple `while read` loops already handle these jobs when used correctly. Commenters contrast the desire for an easier, uniform syntax with the value of learning existing POSIX tools, portability concerns, and the risk of adding yet another wrapper with its own quirks. The exchange broadens into a critique of traditional shells—highlighting Bash’s many footguns, alternative tools like zsh, nushell and PowerShell, and the tension between staying with ubiquitous but archaic utilities and adopting more modern, structured approaches.
Perceived Need for bashumerate
- OP’s goal: single, consistent
{}-based way to iterate over files, lines, ranges, and lists, avoidingfor,find -exec, andxargsflags. - Some find this appealing in principle (one mental model, simple oneliners).
- Others argue it’s not “simpler,” just “easier”: it adds another tool and syntax instead of learning existing ones.
“Just Use the Shell Tools” Camp
- Many say
xargs+find(with-print0/-0) already solve almost all problems, including spaces in filenames and argument list limits. find -exec ... +andfind -deletehighlighted as better, simpler patterns for many examples.- Several recommend
while readloops (often using$REPLY) for line-based iteration, with caveats about subshells when using pipes. - Some show small custom wrapper functions (mini-enumerators) that they’ve built instead of adding a new dependency.
Correctness, Edge Cases, and Syntax Concerns
- Strong emphasis that the “filenames with spaces” problem is solved by NUL-termination (
-print0,xargs -0), now even standardized in POSIX 2024. - Warnings about newlines in filenames and glob expansion limits; some point out that
bashumerate’s glob-based implementation can hit argument/memory issues. - Critiques of
enumeratesyntax: unconventional use of--, quoting requirements, and template-style{}replacement reintroducing quoting/escaping footguns. - Some argue the tool covers only a subset of what
find/loops do, so it becomes extra syntax on top, not a replacement.
Performance and Parallelism
xargspraised for batching arguments and optionally parallelizing (-P), versusfind -exec’s one-process-at-a-time behavior.- Some prefer clarity and simplicity over parallel speed for most day-to-day tasks.
Alternatives and Broader Shell Debates
- Other tools mentioned: GNU Parallel (both praised for power and criticized for UX, citation nag, and first-run behavior),
lr/xe,rush,fd, personal Python/Go wrappers, CSV-based pipelines. - Thread branches into a wider debate: traditional POSIX shell vs more modern shells (zsh, nushell, PowerShell, rc, xonsh).
- One recurring theme: using ubiquitous, standard tools (POSIX
sh/bash+ coreutils) is valued for portability across random systems, despite their quirks.