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
F54725236: D3429.diff
Fri, Oct 23, 00:58
Unknown Object (File)
Wed, Oct 21, 01:30
Unknown Object (File)
Mon, Oct 12, 21:02
Unknown Object (File)
Sun, Oct 11, 02:43
Unknown Object (File)
Sat, Oct 10, 15:32
Unknown Object (File)
Sat, Oct 10, 10:25
Unknown Object (File)
Fri, Oct 9, 23:12
Unknown Object (File)
Thu, Oct 8, 23:48
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