mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1019 (markdown)
28
SC1019.md
Normal file
28
SC1019.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
## Expected this to be an argument to the unary condition.
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[ -x ]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
[ -x "myfile" ]
|
||||||
|
```
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
ShellCheck has found a unary test operator that does not appear to be followed by a valid shell word.
|
||||||
|
|
||||||
|
This could be because of a misplaced `]`, `)`, or a missing space before the `]`.
|
||||||
|
|
||||||
|
Check the syntax, make sure the test operator has an operand, and try again.
|
||||||
|
|
||||||
|
### Exceptions:
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
### Related resources:
|
||||||
|
|
||||||
|
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
|
Reference in New Issue
Block a user