Page MenuHomeDevCentral

Prevent globbing and word splitting for shell script name
ClosedPublic

Authored by dereckson on Sep 6 2024, 21:38.
Tags
None
Referenced Files
F12205111: D3429.diff
Mon, Oct 6, 10:42
Unknown Object (File)
Mon, Oct 6, 01:57
Unknown Object (File)
Sun, Oct 5, 14:02
Unknown Object (File)
Sun, Oct 5, 04:07
Unknown Object (File)
Fri, Oct 3, 22:41
Unknown Object (File)
Thu, Oct 2, 05:12
Unknown Object (File)
Tue, Sep 30, 04:36
Unknown Object (File)
Tue, Sep 30, 03:09
Subscribers
None

Details

Summary

Shellcheck highlights an issue with the shell script snippet:

In roles/core/certificates/files/delete-certbot-certificate.sh line 28:
    echo "Usage: $(basename $0) <certificate>" >&2
                            ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    echo "Usage: $(basename "$0") <certificate>" >&2
Test Plan

Tested with new script in rOPS

Diff Detail

Repository
rSNIPPETS Snippets
Lint
Lint Passed
Unit
No Test Coverage
Branch
fix-basename
Build Status
Buildable 5464
Build 5745: arc lint + arc unit