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
F24627173: D3429.id8851.diff
Mon, Mar 2, 09:35
F24625774: D3429.id8851.diff
Mon, Mar 2, 07:50
F24624343: D3429.id8851.diff
Mon, Mar 2, 06:05
F24622756: D3429.diff
Mon, Mar 2, 04:15
Unknown Object (File)
Sat, Feb 28, 16:17
Unknown Object (File)
Wed, Feb 18, 17:13
Unknown Object (File)
Sat, Feb 14, 07:28
Unknown Object (File)
Sat, Feb 14, 04:13
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