Algebraic scripting?
This little shell trick just occurred to me and I wanted to share.
Often we want to execute a series of commands that contain a common prefix:
git -C /path/to/bare/repo rev-list --count HEAD
git -C /path/to/bare/repo tag
git -C /path/to/pare/repo branch
Admittedly, this example is a bit contrived, but the point is that the long prefix makes it harder to tell at a glance what's going on. We can do this instead: xargs -L1 git -C /path/to/bare/repo <<-GIT
rev-list --count HEAD
tag
branch
GIT
If you squint at this just right, it sort of looks like Haksell's Applicative.