The optional bit messed it up, because even though I can make my scripts easier for me, other’s scripts won’t be.
But then bash had to be usable with sh scripts, so I get it.
Right. It’s optional so that Bash remains backwards compatible as a superset of POSIX sh. If you’re working with exclusively Bash, though, it’s nice to use as syntactic sugar if nothing else.
While
Cfeels fine without having a keyword for function, I feel likebashwould have benefitted from it.Bash (specifically Bash, not POSIX sh) does have a keyword for functions (
function), but it’s optional.Ooh nice.
The optional bit messed it up, because even though I can make my scripts easier for me, other’s scripts won’t be.
But then
bashhad to be usable withshscripts, so I get it.Right. It’s optional so that Bash remains backwards compatible as a superset of POSIX sh. If you’re working with exclusively Bash, though, it’s nice to use as syntactic sugar if nothing else.