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)
Sat, Mar 21, 10:04
Unknown Object (File)
Thu, Mar 19, 13:56
Unknown Object (File)
Tue, Mar 17, 21:17
Unknown Object (File)
Mon, Mar 16, 13:25
Unknown Object (File)
Sat, Mar 14, 00:28
Unknown Object (File)
Fri, Mar 13, 19:10
Unknown Object (File)
Wed, Mar 11, 14:13
Unknown Object (File)
Sun, Mar 8, 07:15
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