3 ms·
I realized how little I knew about sh earlier this year. It struck me that it has by far the highest ratio of "how often I use it" to "how much I know about it
by aidenn0 13y ago
I realized how little I knew about sh earlier this year. It struck me that it has by far the highest ratio of "how often I use it" to "how much I know about it"
So (to learn more about it) I implemented a large fraction of the POSIX shell specification. It was rather fun, and fairly easy in any high level language that can call setenv() and fork() and I learned all sorts of interesting things. Example:
FOO=bar cd .; echo $FOO
will output "bar" in a POSIX compatible shell but not bash. Also, this is completely valid:
for if in case; do echo {; done
since reserved words are only reserved when in the command position.