3 ms·
I think it was just cobbled together. I think from the start the shell scripts were a way to arrange and call actual programs. If I remember correctly the first
by wisnoskij 4y ago
I think it was just cobbled together. I think from the start the shell scripts were a way to arrange and call actual programs. If I remember correctly the first conditionals in shell scripting were literally just calls to the program named "test" I believe or something like that. This resulted in a language with little planning and thought put into it as it expanded to include more and more features.
The biggest problem really seems to be that they wanted to avoid the use of esoteric syntax like double quotes and brackets, which resulted in a very unspecific syntax that is continually uncertain of if you are type strings or commands, so we have to use even more quotes and brackets and things of that nature.
It really makes me wonder why no one seemed to be working on guiding Linux over to some JIT compiled C scripting like TempleOS uses.
- wruza 4y agoIf I remember correctly the first conditionals in shell scripting were literally just calls to the program named "test" I believe or something like that They still are, in a sense. [ is a synonym for test, and ] is a mandatory no-op argument to it, when used as a “built-in” syntax. You can use [ outside of if as well, like [ <condition> ] && <then-action> test <condition> && <then-action> https://linux.die.net/man/1/test https://linux.die.net/man/1/test