git: 7776cec946fb - main - Add quotes around variables and replace backticks with $()

From: Benedict Reuschling <bcr_at_FreeBSD.org>
Date: Wed, 28 Jun 2023 16:53:18 UTC
The branch main has been updated by bcr:

URL: https://cgit.FreeBSD.org/src/commit/?id=7776cec946fbb3a087ace68468c290572398dce9

commit 7776cec946fbb3a087ace68468c290572398dce9
Author:     Benedict Reuschling <bcr@FreeBSD.org>
AuthorDate: 2023-06-28 16:48:39 +0000
Commit:     Benedict Reuschling <bcr@FreeBSD.org>
CommitDate: 2023-06-28 16:48:39 +0000

    Add quotes around variables and replace backticks with $()
    
    The quotes are added to prevent word splits and globbing. Some
    whitespaces were also removed after variables.
    
    Approved by:    imp
    Differential Revision: https://reviews.freebsd.org/D40726
---
 usr.sbin/zzz/zzz.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/usr.sbin/zzz/zzz.sh b/usr.sbin/zzz/zzz.sh
index ef9527bb76b3..d4311ac82302 100644
--- a/usr.sbin/zzz/zzz.sh
+++ b/usr.sbin/zzz/zzz.sh
@@ -18,18 +18,18 @@ APM_SUSPEND_DELAY=machdep.apm_suspend_delay
 # Check for ACPI support
 if sysctl $ACPI_SUSPEND_STATE >/dev/null 2>&1; then
 	# Get configured suspend state
-	SUSPEND_STATE=`sysctl -n $ACPI_SUSPEND_STATE `
+	SUSPEND_STATE=$(sysctl -n $ACPI_SUSPEND_STATE)
 
 	# Get list of supported suspend states
-	SUPPORTED_STATES=`sysctl -n $ACPI_SUPPORTED_STATES `
+	SUPPORTED_STATES=$(sysctl -n $ACPI_SUPPORTED_STATES)
 
 	# Check if the configured suspend state is supported by the system
-	if echo $SUPPORTED_STATES | grep $SUSPEND_STATE >/dev/null; then
+	if echo "$SUPPORTED_STATES" | grep "$SUSPEND_STATE" >/dev/null; then
 		# execute ACPI style suspend command
-		exec acpiconf -s $SUSPEND_STATE
+		exec acpiconf -s "$SUSPEND_STATE"
 	else
 		echo -n "Requested suspend state $SUSPEND_STATE "
-		echo -n "is not supported.  "
+		echo -n "is not supported."
 		echo    "Supported states: $SUPPORTED_STATES"
 	fi
 # Check for APM support