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
Unknown Object (File)
Thu, Jan 9, 05:58
Unknown Object (File)
Thu, Jan 2, 00:02
Unknown Object (File)
Wed, Jan 1, 18:03
Unknown Object (File)
Wed, Jan 1, 18:03
Unknown Object (File)
Wed, Jan 1, 17:30
Unknown Object (File)
Wed, Jan 1, 16:27
Unknown Object (File)
Dec 31 2024, 11:07
Unknown Object (File)
Dec 29 2024, 01:56
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