mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1111 (markdown)
29
SC1111.md
Normal file
29
SC1111.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
## This is a unicode quote. Delete and retype it (or ignore/singlequote for literal).
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo "hello world”
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
echo "hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
Some software, like OS X, Word and WordPress, may automatically replace your regular quotes with slanted Unicode quotes. The shell does not recognize these quotes and will not respect them.
|
||||||
|
|
||||||
|
In this case, you have slanted double quotes in a double quoted string. Try deleting and retyping them, and/or disable “smart quotes” in your editor or OS.
|
||||||
|
|
||||||
|
### Exceptions
|
||||||
|
|
||||||
|
If you want to use literal slanted double quotes for typographic reasons, you can put them in single quotes to make ShellCheck ignore them:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
printf 'Warning: “wakeonlan” is not installed.\n'
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also just [[ignore]] this warning.
|
Reference in New Issue
Block a user