Hot answers tagged

3

Shell originally used only backticks for command substitution: less `find . -type f` But these do not nest and suffer from other problems. Bash (and probably ksh, but I’m not up on the history there) used $() as a newer, improved command substitution. But that explains the difference and while the filetype matters—in fact, the shebang (#! line) matters! If ...


3

This is because the original Bourne shell only understands `...` - the standard $( ... ) syntax was added later. From syntax/sh.vim: " $() and $(()): {{{1 " $(..) is not supported by sh (Bourne shell). However, apparently " some systems (HP?) have as their /bin/sh a (link to) Korn shell " (ie. Posix compliant shell). /bin/ksh should ...


Only top voted, non community-wiki answers of a minimum length are eligible