mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1029 (markdown)
21
SC1029.md
Normal file
21
SC1029.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
## In `[[..]]` you shouldn't escape `(` or `)`.
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[[ -e ~/.bashrc -a \( -x /bin/dash -o -x /bin/ash \) ]]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[[ -e ~/.bashrc -a ( -x /bin/dash -o -x /bin/ash ) ]]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
You don't have to -- and can't -- escape `(` or `)` inside a `[[ .. ]]` expression like you do in `[ .. ]`. Just remove the escaping.
|
||||||
|
|
||||||
|
### Exceptions:
|
||||||
|
|
||||||
|
None.
|
Reference in New Issue
Block a user