mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC2246 (markdown)
28
SC2246.md
Normal file
28
SC2246.md
Normal file
@@ -0,0 +1,28 @@
|
||||
## This shebang specifies a directory. Ensure the interpreter is a file.
|
||||
|
||||
### Problematic code:
|
||||
|
||||
```sh
|
||||
#!/bin/sh/
|
||||
echo "Hello World"
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
echo "Hello World"
|
||||
```
|
||||
### Rationale:
|
||||
|
||||
The shebang specifies which file to use as an interpreter, but probably due to some kind of typo, your script's interpreter ends in a `/`, indicating a directory.
|
||||
|
||||
Ensure it points to a valid executable filename.
|
||||
|
||||
### Exceptions:
|
||||
|
||||
None
|
||||
|
||||
### Related resources:
|
||||
|
||||
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
|
Reference in New Issue
Block a user