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)
Tue, Dec 17, 02:11
Unknown Object (File)
Sun, Dec 15, 11:05
Unknown Object (File)
Sun, Dec 15, 10:48
Unknown Object (File)
Fri, Dec 13, 03:16
Unknown Object (File)
Thu, Nov 28, 03:14
Unknown Object (File)
Sun, Nov 24, 13:43
Unknown Object (File)
Fri, Nov 22, 18:18
Unknown Object (File)
Fri, Nov 22, 16:12
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