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
F52064451: D3429.id8851.diff
Wed, Sep 30, 02:17
F51984828: D3429.id8850.diff
Tue, Sep 29, 13:09
F51984823: D3429.id8851.diff
Tue, Sep 29, 13:08
F51984049: D3429.id.diff
Tue, Sep 29, 12:57
F51983931: D3429.diff
Tue, Sep 29, 12:57
Unknown Object (File)
Mon, Sep 28, 06:45
Unknown Object (File)
Sun, Sep 27, 22:06
Unknown Object (File)
Sun, Sep 27, 15:50
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 Not Applicable
Unit
Tests Not Applicable