Consider the following shell code:
unset foo
echo "${foo-'}'}"
The result depends on which shell is used:
'}'
''}
Missing }.
''}
Which shell(s) behave(s) according to the POSIX standard?
Bash uses backslash escapes. Zsh uses percentage escapes. Bash doesn't have an inline wildcard expansion. Zsh has a built-in wildcard expansion.
Bash stands for Bourne Again Shell which is a clone of Bourne shell. It is licensed under GNU so it is open source and is available for free for the general public whereas KSH stands for Korn shell which was developed by David Korn which merges the features of many shells like Bourne shell, C shell, TC shell, etc.
ksh tend to be the default or at least the standard compliant shell on many Unix like Solaris, AIX, HP-UX while zsh is often only an optional shell that needs to be installed separately.
Tcsh: different shell and environment variables can have same name! Tcsh: why is there a ' path ' shell variable? Bash: file descriptors can be used! (Ba)sh: scripts are everywhere and are considered better!
A POSIX-compliant shell should output:
''}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With