3 ms·
I'm starting to wonder how the hell anyone decided shellscripts were a good idea.
by Qwertious 9y ago
I'm starting to wonder how the hell anyone decided shellscripts were a good idea.
- chubot 9y agoI think it started the same way batch files did -- although of course shell came earlier. "Hey let me put the stuff I type in a text file": mkdir foo cp myfile foo/ ls foo "Then I don't have to type it over and over". The "interpreter" was probably a 20 line function inside the interactive shell, or maybe just a single if statement to redirect stdin from a file and not a terminal. That started sometime in the early 1970's. Along the way, people added loops, conditionals, functions, various hacky expression languages (test/[, find), many external utilities like sed/grep, full-fledged languages like awk/make, etc. And today we have on perhaps 50 million+ machines an unbroken chain from 45+ years ago. It's kind of amazing... If you can somehow score languages by how old they are plus how widely used they are, shell is probably #2 behind C. C has had a ton of effort that has gone into cleaning it up, deciding upon semantics, standardizing it, evolving it. Shell has had POSIX, which was like 30 years ago, and that's about it. In summary, nobody "decided" -- it's an amazing and horrible instance of evolution :)