by alkonaut · 10y ago · 0 comments
What happens if I make a shell that does expansion slightly diffrently to the existing shells? That can't work well? So there is already a set of rules for expansion and all shells must implement them exactly? That does sound just slightly better than the apps trying to do the same thing?
In theory this applies to shell developers as well; however POSIX specifies how expansions should work, and there are far fewer shells than there are programs that those shells launch; and shells that don't conform to POSIX are less likely to find adoption because they will break user expectation.
https://www.gnu.org/software/libc/manual/html_node/Pattern-M...
Don't know if they are commonly used by shells however.
We have different shells with different expansions (and a myriad other differences) and it doesn't work well.
In practice, the result is that people write bash scripts, not shell scripts.
(Though they often don't know, and so use #!/bin/sh anyway, and so the scripts break whenever the default shell isn't bash.)