RHEL8-CIS-Audit
RHEL8-CIS-Audit copied to clipboard
Syntax error on run_audit.sh
Describe the Issue
When running run_audit.sh
, you get the following error:
tr: missing operand after ‘[:lower:]’
Two strings must be given when translating.
Try 'tr --help' for more information.
Expected Behavior This error shouldn't be thrown. This is clearly a syntax error in the script.
Actual Behavior You get a syntax error
Control(s) Affected
- run_audit.sh
Environment (please complete the following information):
- goss version: 0.4.2
- OS version: openSUSE Tumbleweed on WSL
- Additional Details:
Additional Notes Testing the code on my WSL sandbox before launching it in the actual environment
Possible Solution On line 86 the following possible amendments can be made:
-
os_vendor="$(hostnamectl | grep Oper | cut -d: -f2 | awk '{print $1}' | tr '[:upper:]' '[:lower:]')"
-
os_vendor="$(hostnamectl | grep Oper | cut -d: -f2 | awk '{print tolower($1)}')"