For all those little papers scattered across your desk
Like many other full-time shell users, I write small utilities to add to my toolbox. Let’s compare.
Update 2024 November 17: Add notes on git-q
and git-vee
.
I stumbled on MJD’s blog via a Git Rev News article from last year and found a post about little utilities. Clearly great minds think alike:
f
command to extract a single field. It’s written in Perl. I
have a fields
script that uses
dynamically-generated AWK to extract as many fields as you want. It’s a longer
name but useful in more situations.runN
, a (mostly sequential but sometimes
parallel) command runner that replaces some simple loops. But this is a
straightforward variation on moreutils
parallel
command1, so that’s what I use when I remember to.In another post, MJD mentions two Git utilities:
git vee
as a wrapper around git log
over a symmetric difference
shows how branches have diverged. My take, git
div
infers the arguments that I would normally pass (like base...upstream
) and
allows to specify them, but the inference is intentionally unsophisticated. I
consider this a companion to git sbup
(git show-branch HEAD HEAD@{upstream}
HEAD@{push}
).git q
: my
take
is pure shell and only runs a single subprocess rather than one for each ref.
This collapses equivalent refs but is ~50x more performant (see hyperfine
output in the commit).In the words of moreutils: there’s room for more little unix utilities!
The moreutils syntax and manual I
vastly prefer to GNU parallel
,
although GNU parallel supports niceties like a job log, retries, output
syndication, etc. For “heavy lifting,” I am forced to use GNU parallel (I
try to write detailed notes on expected uses then), but for short one-liners
I prefer the moreutils version. ↩