Skip to content

Files

Latest commit

 

History

History
15 lines (8 loc) · 725 Bytes

SC2040.md

File metadata and controls

15 lines (8 loc) · 725 Bytes

Pattern: Use of unsupported #!/bin/sh feature

Issue: -

Description

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 and suggestions on how to rewrite them.

Further Reading