Which Shells Don’t Support Dollar-Parenthesis Expansion?

command-substitutionportabilityshell

The modern recommendation is to use:

$(...)

instead of the older:

`...`

mainly for readability and to avoid the need for escaping when nesting.

Which shells do not support the $(...) form, and are any of them still in use today?

Best Answer

The original Bourne shell, csh or tcsh all do not support $() and require `` for command substitution.

The Bourne shell is no longer used as the default shell (/bin/sh) on many UNIX based operating systems. However, these shells are still supplied by the OS vendors as they are still used for historical reasons.

Both AIX and HP-UX have /bin/sh as a POSIX compliant shell. Bourne shell is still available on AIX as 'bsh' (but deprecated in 1995 with AIX 4.1) and HP-UX 11.11 '/usr/old/bin/sh' (Bourne was removed from 11.23). I'm not sure when the switch was made, but it was many years ago.