---
title: Add a valid shebang as the first line of executable shell scripts
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Static Code Analysis (SAST) > SAST
  Rules > Add a valid shebang as the first line of executable shell scripts
---

# Add a valid shebang as the first line of executable shell scripts

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ().
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**ID:** `bash-code-quality/missing-shebang`

**Language:** Bash

**Severity:** Notice

**Category:** Code Style

## Description{% #description %}

Without `#!` on line one, a script run directly is executed by whatever `/bin/sh` points to (often dash or ash), not necessarily Bash. Bash-only syntax can then fail in confusing ways or behave differently than on your interactive shell. Put a valid interpreter line first, for example `#!/usr/bin/env bash` or an absolute path like `#!/bin/bash`, matching what you actually need.

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```bash
# not a shebang
echo "if this were line 1 there would still be no interpreter path after #!"
true
```

## Compliant Code Examples{% #compliant-code-examples %}

```bash
#!/bin/bash
echo ok
```
  Seamless integrations. Try Datadog Code SecurityDatadog Code Security 
{% icon name="icon-external-link" /%}
 