mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC2040 (markdown)
7
SC2040.md
Normal file
7
SC2040.md
Normal file
@@ -0,0 +1,7 @@
|
||||
## #!/bin/sh was specified, so ____ is not supported, even when sh is actually bash.
|
||||
|
||||
The shebang indicates that the script works with `/bin/sh`, but you are using non-standard features that may not work with `/bin/sh`, **even if /bin/sh is actually bash**. Bash behaves differently when invoked as `sh`, and disabling support for the highlighted feature is one part of that.
|
||||
|
||||
Specify `#!/usr/bin/env bash` to ensure that bash (or your shell of choice) will be used, or rewrite the script to be more portable.
|
||||
|
||||
The Ubuntu wiki has [a list of portability issues](https://wiki.ubuntu.com/DashAsBinSh) and suggestions on how to rewrite them.
|
Reference in New Issue
Block a user