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
F23631702: D3429.id8850.diff
Thu, Feb 5, 19:26
F23631011: D3429.id8851.diff
Thu, Feb 5, 19:22
Unknown Object (File)
Tue, Feb 3, 12:53
Unknown Object (File)
Tue, Feb 3, 04:59
Unknown Object (File)
Sun, Feb 1, 22:20
Unknown Object (File)
Sat, Jan 31, 11:08
Unknown Object (File)
Sat, Jan 31, 09:50
Unknown Object (File)
Sat, Jan 31, 09:49
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