Shebang Syntax Correction Medium

Spaces between '#' and '!' in the shebang prevent the operating system from recognizing the file as a script. To fix this, remove any spaces between '#' and '!' in the shebang line, ensuring they are directly adjacent.

Detector ID
shell/shebang-syntax-correction@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-
Tags
-

Noncompliant example

1	 
2# Noncompliant: There are spaces in between `#` and `!` in the shebang.
3# !/bin/bash
4echo "Hello Shell"

Compliant example

1	 
2# Compliant: No spaces between `#` and `!` in the shebang.
3#!/bin/bash
4echo "Hello Shell"