[LEDE-DEV] [PATCH v3 08/13] scripts: Use $(..) instead of legacy `..`
Jan-Tarek Butt
tarek at ring0.de
Thu Oct 6 01:50:35 PDT 2016
Signed-off-by: Jan-Tarek Butt <tarek at ring0.de>
---
scripts/deptest.sh | 4 ++--
scripts/gen-dependencies.sh | 4 ++--
scripts/ipkg-make-index.sh | 4 ++--
scripts/mkits.sh | 4 ++--
scripts/patch-kernel.sh | 2 +-
scripts/strip-kmod.sh | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/scripts/deptest.sh b/scripts/deptest.sh
index efa3c5a..27808ac 100755
--- a/scripts/deptest.sh
+++ b/scripts/deptest.sh
@@ -86,7 +86,7 @@ test_package() # $1=pkgname
[ -n "$pkg" -a -z "$(echo "$pkg" | grep -e '/')" -a "$pkg" != "." -a "$pkg" != ".." ] || \
die "Package name \"$pkg\" contains illegal characters"
local SELECTED=
- for conf in `grep CONFIG_PACKAGE tmp/.packagedeps | grep -E "[ /]$pkg\$" | sed -e 's,package-$(\(CONFIG_PACKAGE_.*\)).*,\1,'`; do
+ for conf in $(grep CONFIG_PACKAGE tmp/.packagedeps | grep -E "[ /]$pkg\$" | sed -e 's,package-$(\(CONFIG_PACKAGE_.*\)).*,\1,'); do
grep "$conf=" .config > /dev/null && SELECTED=1 && break
done
local STAMP_SUCCESS="$STAMP_DIR_SUCCESS/$pkg"
@@ -200,7 +200,7 @@ bootstrap_native_make()
if [ -z "$packages" ]; then
# iterate over all packages
- for pkg in `cat tmp/.packagedeps | grep CONFIG_PACKAGE | grep -v curdir | sed -e 's,.*[/=]\s*,,' | sort -u`; do
+ for pkg in $(cat tmp/.packagedeps | grep CONFIG_PACKAGE | grep -v curdir | sed -e 's,.*[/=]\s*,,' | sort -u); do
test_package "$pkg"
done
else
diff --git a/scripts/gen-dependencies.sh b/scripts/gen-dependencies.sh
index c77b5e4..8f3c8a7 100755
--- a/scripts/gen-dependencies.sh
+++ b/scripts/gen-dependencies.sh
@@ -24,8 +24,8 @@ find "$TARGETS" -type f -a -exec file {} \; | \
awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \
sort -u
-tmp=`mktemp "$TMP_DIR"/dep.XXXXXXXX`
-for kmod in `find "$TARGETS" -type f -name \*.ko`; do
+tmp=$(mktemp "$TMP_DIR"/dep.XXXXXXXX)
+for kmod in $(find "$TARGETS" -type f -name \*.ko); do
$OBJCOPY -O binary -j .modinfo "$kmod" "$tmp"
sed -e 's,\x00,\n,g' "$tmp" | \
sed -ne '/^depends=.\+/ { s/^depends=//; s/,/.ko\n/g; s/$/.ko/p; q }'
diff --git a/scripts/ipkg-make-index.sh b/scripts/ipkg-make-index.sh
index e1ecf87..8c525a5 100755
--- a/scripts/ipkg-make-index.sh
+++ b/scripts/ipkg-make-index.sh
@@ -11,7 +11,7 @@ fi
which md5sum >/dev/null 2>&1 || alias md5sum=md5
empty=1
-for pkg in `find "$pkg_dir" -name '*.ipk' | sort`; do
+for pkg in $(find "$pkg_dir" -name '*.ipk' | sort); do
empty=
name="${pkg##*/}"
name="${name%%_*}"
@@ -22,7 +22,7 @@ for pkg in `find "$pkg_dir" -name '*.ipk' | sort`; do
md5sum=$(md5sum "$pkg" | awk '{print $1}')
sha256sum=$(openssl dgst -sha256 "$pkg" | awk '{print $2}')
# Take pains to make variable value sed-safe
- sed_safe_pkg=`echo "$pkg" | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g'`
+ sed_safe_pkg=$(echo "$pkg" | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g')
tar -xzOf "$pkg" ./control.tar.gz | tar xzOf - ./control | sed -e "s/^Description:/Filename: $sed_safe_pkg\\
Size: $file_size\\
MD5Sum: $md5sum\\
diff --git a/scripts/mkits.sh b/scripts/mkits.sh
index 3e75e8d..99b86a8 100755
--- a/scripts/mkits.sh
+++ b/scripts/mkits.sh
@@ -15,7 +15,7 @@
#
usage() {
- echo "Usage: `basename "$0"` -A arch -C comp -a addr -e entry" \
+ echo "Usage: $(basename "$0") -A arch -C comp -a addr -e entry" \
"-v version -k kernel [-D name -d dtb] -o its_file"
echo -e "\t-A ==> set architecture to 'arch'"
echo -e "\t-C ==> set compression type 'comp'"
@@ -53,7 +53,7 @@ if [ -z "${ARCH}" ] || [ -z "${COMPRESS}" ] || [ -z "${LOAD_ADDR}" ] || \
usage
fi
-ARCH_UPPER=`echo "$ARCH" | tr '[:lower:]' '[:upper:]'`
+ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]')
# Conditionally create fdt information
if [ -n "${DTB}" ]; then
diff --git a/scripts/patch-kernel.sh b/scripts/patch-kernel.sh
index 4ca8783..8446d1e 100755
--- a/scripts/patch-kernel.sh
+++ b/scripts/patch-kernel.sh
@@ -45,7 +45,7 @@ for i in ${patchdir}/${patchpattern} ; do
done
# Check for rejects...
-if [ "`find "$targetdir"/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+if [ "$(find "$targetdir"/ '(' -name '*.rej' -o -name '.*.rej' ')' -print)" ] ; then
echo "Aborting. Reject files found."
exit 1
fi
diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh
index c56b8a5..aac953f 100755
--- a/scripts/strip-kmod.sh
+++ b/scripts/strip-kmod.sh
@@ -52,6 +52,6 @@ $3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ && !def[$3] {
' > "$MODULE.tmp1"
# shellcheck disable=SC2046
-"${CROSS}"objcopy `cat "${MODULE}".tmp1` "${MODULE}".tmp "${MODULE}".out
+"${CROSS}"objcopy $(cat "${MODULE}".tmp1) "${MODULE}".tmp "${MODULE}".out
mv "${MODULE}.out" "${MODULE}"
rm -f "${MODULE}".t*
--
2.10.0
More information about the Lede-dev
mailing list