Text is cool again

I'm working with text everyday, whether from my emacs windows or from the terminal.

In the terminal, I use pipes everyday. I love this old-school AT&T video featuring Lorinda Cherry11: About which you can know more by reading the obituary Douglas McIlroy wrote for her. demonstrating the use of pipes for spell checking (notice e.g. how uniq is spelled unique).

I also love the meta-ness of the command line, where you can use the command line to look back on you usage of the command line.

For example, I was curious about which command in my history got the most pipes in it, so I cooked up this bash 'one'-liner:

cat ~/.local/share/fish/fish_history | \
    (while read line ; \
    do echo -n $line | \sed 's/[^|]//g' ; \
    echo -n "                       "; \
    echo -$line ; done) | LC_COLLATE=C sort

And the winner was:

grep -ri -P newcommand..invoiceNo . | sed 's|:.*{|\t\t\t\t|;s/}$//'  | \
    column --table | sort -nk2 | grep 2425I | tr -s ' ' | cut -d ' ' -f2 | sort

A line I use to find the biggest invoice number I've used so far in my LaTeX-based invoicing system. Not the cleanest code ever, but it works.

What I'm happy about these days is that LLMs are making text cool again.

Sure, the most popular interfaces are web-based and for a while I ended up copy pasting stuff back and forth. But since then I've been enlightened by Justine and now natural language can be part of a UNIX pipeline. The --grammar option is a godsend, as it can coerce the LLM's output into something the following UNIX tool in the pipeline can parse with no errors. It really feels like the future.

For an example of this, see my LinkedIn-ify scripts.

I've also now cobbled together a custom interface for emacs, but that's a story for another day.

1. Changelog

<2025-01-07 Tue> Added a link to an example <2025-01-06 Mon> Initial version