Skip to content

Support env -S unshare SHELL in shebang lines #3390

@Winterhuman

Description

@Winterhuman

For new checks and feature suggestions

Here's a snippet or screenshot that shows a potential problem:

I've been using unshare in my script's shebangs to sandbox them; however, doing so prevents shellcheck from knowing what shell is being used. For example:

#!/usr/bin/env -S unshare --mount --map-root-user /bin/sh
[...]

Here's what shellcheck currently says:

SC1008 (error): This shebang was unrecognized. [...]

Here's what I wanted to see:

It'd be handy if shellcheck could handle unshare inside env -S lines somehow (if reasonable to implement). Alternatively, using --shell or # shellcheck shell=sh solves this issue manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions