4 ms·
(author here) I agree a lot of this stuff hasn't been documented well in existing shell resources. I should write more about it, but I'm still busy working on
by chubot 7y ago
(author here)
I agree a lot of this stuff hasn't been documented well in existing shell resources. I should write more about it, but I'm still busy working on the Oil shell implementation nearly 3 years later :) I should have written a post about xargs 2 years ago, which has nontrivial compositional patterns. Hopefully next year!
I still recommend The Art of Unix Programming (mentioned in this post), which is more generally about Unix design, not about shell in particular.
I also got a lot of ideas by reading DJB's shell and C code, and his papers (e.g. Ten Years of qmail Security). I probably learned about DJB 10 years ago from Hacker News.
I would say there's a lot of "tribal knowledge" in people's heads, and online forums are where it gets disseminated. For me those forums were Usenet, the old JOS forum, and Hacker News and lobste.rs these days.
----
Neil Stephenson has a good quote about this "oral history"
Unix, by contrast, is not so much a product as it is a painstakingly compiled oral history of the hacker subculture. It is our Gilgamesh epic.
https://en.wikipedia.org/wiki/In_the_Beginning..._Was_the_Command_Line https://en.wikipedia.org/wiki/In_the_Beginning..._Was_the_Co...
https://en.wikipedia.org/wiki/Epic_of_Gilgamesh https://en.wikipedia.org/wiki/Epic_of_Gilgamesh
The next post has the "point-free" pipline pattern which is both useful and hard to find out about!
hist() { sort | uniq -c | sort -n -r; }
Pipelines Support Vectorized, Point-Free, and Imperative Style
http://www.oilshell.org/blog/2017/01/15.html http://www.oilshell.org/blog/2017/01/15.html