The difference between bash, ksh, tcsh and zsh

Consider the following shell code:

unset foo
echo "${foo-'}'}"

The result depends on which shell is used:

  • bash: '}'
  • ksh: ''}
  • tcsh: Missing }.
  • zsh: ''}

Which shell behaves in accordance with the POSIX standard?

+4
source share
1 answer

POSIX-compatible shell should output:

''}
+1
source

Source: https://habr.com/ru/post/1688203/


All Articles