mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 11:19:45 +08:00
Created SC1100 (markdown)
24
SC1100.md
Normal file
24
SC1100.md
Normal file
@@ -0,0 +1,24 @@
|
||||
## This is a unicode dash. Delete and retype as ASCII minus.
|
||||
|
||||
### Problematic code:
|
||||
|
||||
```sh
|
||||
[[ 3 –gt 2 ]] # Uses unicode en-dash character
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```sh
|
||||
[[ 3 -gt 2 ]] # Uses regular ASCII hyphen-minus character
|
||||
```
|
||||
### Rationale:
|
||||
|
||||
A character that looks similar to `-` has made its way into your code. This is usually due to copy-pasting from blogs and other websites that formatted code as text, replacing the ASCII hyphen-minus with a Unicode dash character.
|
||||
|
||||
To fix it, simply delete and retype it.
|
||||
|
||||
For a large script, you can use your editor's Search&Replace by copy-pasting the bad dash.
|
||||
|
||||
### Exceptions:
|
||||
|
||||
None. If you want a literal Unicode dash character, just quote it.
|
Reference in New Issue
Block a user