← Back to context

Comment by tame3902

5 hours ago

It depends on what you are looking for. My recommendation for learning "how is X done in a shell" is the OpenBSD ksh: https://github.com/ibara/oksh

It's what they use for /bin/sh, it has everything that a complete shell needs (including a mechanism for providing command completions) and has code that is much easier to read than bash or zsh.

Something that I also would recommend is the design document for the plan9 rc shell; it is a worthwhile read for anybody interested in shells: https://doc.cat-v.org/plan_9/4th_edition/papers/rc

An implementation is also available if one wants to look at how it could be done: https://github.com/rakitzis/rc