Re:Patch runs ed, and ed can run anything
by kragen on Thursday April 05, 2018 @03:23PM
(#16768103)
I don't think it's so much that people wanted patch to be able to run arbitrary code, but rather that writing your tools to be very flexible allows you to get the functionality you need with very little code. The first version of ctags was written as a shell script that invoked ed to do the heavy lifting, for example. It was a small fraction of the rewrite of ctags in C in later Unixes.
So that's how you end up with m4 being Turing-complete, being able to put shell commands in anything, that sort of thing.
So that's how you end up with m4 being Turing-complete, being able to put shell commands in anything, that sort of thing.