4 ms·
Improving on the Unix shell
- dredmorbius 10y agoThe most powerful aspect of the shell (I use bash, though would strongly recommend zsh to newcomers) offers is that the same tool is used for both interactive and scripting tasks. That is, there's no cognitive switch between "I'm working on this interactively", and "I'm working on this in a scripting sense". This also allows the user to try out and learn new capabilities or features in an interactive, rapid-feedback mode, and then apply them to scripting. There's also a vastly greater opportunity for exposure and practice -- the shell is what you use, and you're constantly refining skills. The fact that virtually all of my scripts start off as command and pipelines that then get iteratively extended, is another key element -- it's trivially easy to go from "manual" to "scripted". There are other elements -- the degree to which a good shell supports recall and revision of earlier commands (discovering incremental recursive search in bash was a sea change for me), defining aliases and functions, and much more. And of course, there are the limitations and gotchyas, some of which were somewhat fairly considered in the "death of the Unix Philosophy" essay -- otherwise rather poorly considered, IMO, for reasons well-stated in the discussion on that thread.