mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1114 (markdown)
24
SC1114.md
Normal file
24
SC1114.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
## Remove leading spaces before the shebang.
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
#!/bin/sh
|
||||||
|
echo "Hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
#!/bin/sh
|
||||||
|
echo "Hello World"
|
||||||
|
```
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
The script has leading spaces before the shebang (`#!`). This is not allowed.
|
||||||
|
|
||||||
|
The `#!` should be the first two bytes in the file, as they're used as a file signature by the OS to determine whether a file is a script.
|
||||||
|
|
||||||
|
### Exceptions:
|
||||||
|
|
||||||
|
None.
|
Reference in New Issue
Block a user