mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
change '..' to 'STATEMENT'. Because initially, when I see '..', I thought it means go to parent directory.
@@ -1,4 +1,4 @@
|
|||||||
# Use $(..) instead of legacy \`..\`
|
# Use $(STATEMENT) instead of legacy \`STATEMENT\`
|
||||||
|
|
||||||
### Problematic code
|
### Problematic code
|
||||||
|
|
||||||
@@ -14,13 +14,13 @@ echo "Current time: $(date)"
|
|||||||
|
|
||||||
### Rationale
|
### Rationale
|
||||||
|
|
||||||
Backtick command substitution `` `..` `` is legacy syntax with several issues.
|
Backtick command substitution `` `STATEMENT` `` is legacy syntax with several issues.
|
||||||
|
|
||||||
1. It has a series of undefined behaviors related to quoting in POSIX.
|
1. It has a series of undefined behaviors related to quoting in POSIX.
|
||||||
1. It imposes a custom escaping mode with surprising results.
|
1. It imposes a custom escaping mode with surprising results.
|
||||||
1. It's exceptionally hard to nest.
|
1. It's exceptionally hard to nest.
|
||||||
|
|
||||||
`$(..)` command substitution has none of these problems, and is therefore strongly encouraged.
|
`$(STATEMENT)` command substitution has none of these problems, and is therefore strongly encouraged.
|
||||||
|
|
||||||
### Exceptions
|
### Exceptions
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user