Created 2148 (markdown)

koalaman
2014-08-09 13:28:23 -07:00
parent 328d5345d8
commit c9182650ae

22
2148.md Normal file

@@ -0,0 +1,22 @@
## Include a shebang (#!) to specify the shell.
### Problematic code:
echo "Hello World"
### Correct code:
#!/bin/sh
echo "Hello World"
### Rationale:
ShellCheck noticed that your file does not start with a shebang. Shebangs are good for a number of reasons:
* They allow scripts to be executed outside of interactive prompts.
* They ensure the script is executed by the correct shell.
* Editors and utilities (including shellcheck) use it to determine the file type.
### Contraindications
For checking snippets, use `shellcheck -e 2148`. This is the default for [shellcheck.net](http://www.shellcheck.net).