3 ms·
A couple of months ago, I was doing some nasty shell hacking, and I came across 'tsort'. It is of limited utility in my day to day existence, but when I needed
by jfb 16y ago
A couple of months ago, I was doing some nasty shell hacking, and I came across 'tsort'. It is of limited utility in my day to day existence, but when I needed it, I really needed it. Thanks, whichever hacker decided it should be a standalone utility!
- silentbicycle 16y agoContext: tsort is a topological sorter, which is nice for handling & finding loops in dependency graphs. IIRC there's an example in _The Awk Programming Language_ implementing a toy make out of a topological sorter. (Edit: pgs. 170-8.)
- jfb 16y agoRight, I should have said. EDIT: Topological sorting is one of those tools that really comes in handy -- it's easy enough to implement, but I didn't want to spend the time either (a) writing it in zsh or (b) rewriting the rest of the shell pipeline in Python or something. 'tsort' to the rescue! I just wish I could remember where I read about it so I could go buy whoever was at the other end of the Google search a beer.