mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-03-12 12:35:25 -07:00
Created SC2096 (markdown)
parent
98c0dbb74a
commit
869fb464ed
20
SC2096.md
Normal file
20
SC2096.md
Normal file
@ -0,0 +1,20 @@
|
||||
## On most OS, shebangs can only specify a single parameter.
|
||||
|
||||
### Problematic code:
|
||||
|
||||
#!/usr/bin/env bash -x
|
||||
|
||||
### Correct code:
|
||||
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
|
||||
### Rationale:
|
||||
|
||||
Most operating systems, including Linux, FreeBSD and OS X, allow only a single parameter in the shebang. In the example, `env` will be called with a single parameter -- `bash -x` -- and will therefore fail.
|
||||
|
||||
The shebang should be rewritten to use at most one parameter. Shell options can instead be set in the body of the script.
|
||||
|
||||
### Contraindications
|
||||
|
||||
None.
|
Loading…
x
Reference in New Issue
Block a user