Content-Type: text/shitpost


Subject: Software Archaeology
Path: you​!your-host​!walldrug​!prime-radiant​!uunet​!asr33​!kremvax​!hal9000​!plovergw​!shitpost​!mjd
Date: 2018-01-06T18:26:33
Newsgroup: misc.misc.shuffle
Message-ID: <7dee1ba2231681f4@shitpost.plover.com>
Content-Type: text/shitpost

Just now I needed a utility that would read standard input and emit the same lines in a random order. “Eh,” I said. “Maybe Linux comes with one already. I wonder if there's a shuffle command?” So I ran which shuffle and got an encouraging response:

   % which shuffle
   /home/mjd/bin/shuffle 

Have I been in this movie before? I was quite hopeful at this point; I guessed that either that shuffle would be exactly what I wanted, or else it would shuffle its command-line arguments and print them on a single line. So I ran:

   % shuffle

to see what would happen, and it did nothing, presumably because it was waiting for standard input. Better and better!

It did turn out to be exactly what I wanted, and I had no idea that I had it. I wonder when was the last time I used it? It might have been a very long time ago:

     % ls -l $(which shuffle)
     -rwxr-xr-x 1 mjd mjd 91 Aug  7  2006 /home/mjd/bin/shuffle

Wow. It's even possible that this is the first time that I've used it since 2006.

In Vernor Vinge's novels there are people who make a living doing “software archaeology”: you need to do some complex task, and maybe you don't have enough time (or enough understanding) to write a program to do it, but maybe you do have time to exhume and refurbish some thousand-year-old piece of software that does do it.