mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Add note: the $() was introduced in ksh 1989 and by 2011 all OS "sh" have support built-in
@@ -22,6 +22,8 @@ Backtick command substitution `` `...` `` is legacy syntax with several issues.
|
||||
|
||||
`$(...)` command substitution has none of these problems, and is therefore strongly encouraged.
|
||||
|
||||
Note: The `$(...)` syntax was introduced in the 1989 Korn Shell (ksh). Finally, in 2011, Solaris 11 was the last operating system to switch from the Bourne Shell to the Korn Shell. After 2011, all typical shells have supported the POSIX `$(...)` notation.
|
||||
|
||||
### Exceptions
|
||||
|
||||
- Some legacy sh implementations (like Solaris) do not support `$(...)`, it is necessary to use backtick command substitution there. See [\[mc-devel\] \[PATCH\] Prefer $() to backticks in sh script](https://lists.midnight-commander.org/pipermail/mc-devel/2024-November/011241.html) and follow-ups.
|
||||
|
Reference in New Issue
Block a user