Skip to content

Tools

Wed, 19 Jun 2024, 09:22 AM (-06:00) Creative Commons License

1. Small is Beautiful!

There’s a strong preference in the Unix community for small, simple tools. It’s a philosophy that emerged roughly at the same time as E.F.Schumacher’s classic reflection on economics.

cover of Schumacher's Small is Beautiful, Economics as if People Mattered

The Unix Way was a philosophy spread informally but also in books, some of which are on the shelves in the other room.

cover of P.J. Plauger's book, Programming on Purpose cover of Kernighan and Plauger's book, Software Tools in Pascal cover of Kernighan and Pike's book, The Practice of Programming

Bookshelves that line the walls floor to ceiling, interior designer recommendations to ditch them notwithstanding.

2. Simplicity In Practice?

Simple software tools glued together in simple ways.

For example, to remove all the PDF files in a directory except those ending in STUDENT , you might assemble rm, ls, and grep thusly

rm -f `ls *.pdf | grep -v -STUDENT`

And as I wrote the underlying automation for the next generation of my Algebra 2 guided notes, I embedded just such a snippet into a bash script. Except that a non-fatal error message consistently showed when there were no PDF files to begin with.

Bad juju. Can’t have error messages, fatal or not, lurking in the soul of the machine. But where was it coming from? Finding out was a drag, because it required disassembling the tools and individually checking them out.

In the end, the solution was (as it often is) to use find, a Swiss Army knife of complexity. No one remembers how to use it, ever. It is the antithesis of the Unix Way. But with that single (complex) tool, the job was so much easier.

find . -name “*.pdf” ! -name “*-STUDENT.pdf” -type f -delete

And it reads better, doesn’t it? Bonus: no more error messages.

Now, on to the math…

© jumpingfish by David Hasan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License