minus-squareexcess0680@lemmy.worldtoProgrammer Humor@programming.dev•functionslinkfedilinkarrow-up2·21 hours agoRight. 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. linkfedilink
minus-squareexcess0680@lemmy.worldtoProgrammer Humor@programming.dev•functionslinkfedilinkarrow-up2·1 day agoBash (specifically Bash, not POSIX sh) does have a keyword for functions (function), but it’s optional. linkfedilink
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.