Skip to content

Do not lint reused variable in trap #3422

@A4-Tacks

Description

@A4-Tacks

For bugs with existing features

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

#!/bin/bash
trap "rm ${DIR@Q}" int

Here's what shellcheck currently says:

In - line 2:
trap "rm ${DIR@Q}" int
         ^------^ SC2064 (warning): Use single quotes, otherwise this expands now rather than when signalled.

Here's what I wanted or expected to see:

No warnings

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