From 869fb464ed940307a1944f46179cef6c022882b9 Mon Sep 17 00:00:00 2001 From: koalaman Date: Wed, 4 Jun 2014 09:08:38 -0700 Subject: [PATCH] Created SC2096 (markdown) --- SC2096.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 SC2096.md diff --git a/SC2096.md b/SC2096.md new file mode 100644 index 0000000..ce80aea --- /dev/null +++ b/SC2096.md @@ -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. \ No newline at end of file