From 23917026c656af38ef6d781622184d06dcf72ed3 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Tue, 12 Dec 2023 10:25:49 -0600
Subject: [PATCH v1 3/6] Remove use of backticks for running processes in
 find_typedef

Backticks are the legacy form of command substitution, required by only
the very oldest of non-POSIX-compatible Bourne shells.

Per POSIX:

> The "$()" form of command substitution solves a problem of inconsistent
> behavior when using backquotes.

Link: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03
---
 src/tools/find_typedef | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tools/find_typedef b/src/tools/find_typedef
index ac798a90c1..e04c642da8 100755
--- a/src/tools/find_typedef
+++ b/src/tools/find_typedef
@@ -33,12 +33,12 @@ fi
 
 for DIR
 do	# if objdump -W is recognized, only one line of error should appear
-	if [ `objdump -W 2>&1 | wc -l` -eq 1 ]
+	if [ $(objdump -W 2>&1 | wc -l) -eq 1 ]
 	then	# Linux
 		objdump -W "$DIR"/* |
 		grep -E -A3 '\(DW_TAG_typedef\)' |
 		awk ' $2 == "DW_AT_name" {print $NF}'
-	elif [ `readelf -w 2>&1 | wc -l` -gt 1 ]
+	elif [ $(readelf -w 2>&1 | wc -l) -gt 1 ]
 	then	# FreeBSD, similar output to Linux
 		readelf -w "$DIR"/* |
 		grep -E -A3 '\(DW_TAG_typedef\)' |
-- 
Tristan Partin
Neon (https://neon.tech)

