diff options
author | Stewart Smith <stewart@linux.ibm.com> | 2018-09-10 14:20:03 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-09-13 15:19:36 +1000 |
commit | 084e37bab1cf6fb334af3f2c8a77f0f260eb91fe (patch) | |
tree | 3d2a955eec28f6f31b25a9528497f84fb5641e81 | |
parent | 9ff660e218345ac21f266d0a8dc8514f5d651e64 (diff) | |
download | talos-skiboot-084e37bab1cf6fb334af3f2c8a77f0f260eb91fe.tar.gz talos-skiboot-084e37bab1cf6fb334af3f2c8a77f0f260eb91fe.zip |
Use $() rather than backticks in all shell
The cool kids are all using $() these days as backticks are all
backwards and uncool.
Practically speaking, it makes it easier to escape things, nest things,
and all the other reasons listed on http://mywiki.wooledge.org/BashFAQ/082
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rwxr-xr-x | libstb/sign-with-local-keys.sh | 2 | ||||
-rwxr-xr-x | make_offsets.sh | 2 | ||||
-rwxr-xr-x | make_version.sh | 12 | ||||
-rwxr-xr-x | opal-ci/build-centos7.sh | 8 | ||||
-rwxr-xr-x | opal-ci/build-fedora27.sh | 4 | ||||
-rwxr-xr-x | opal-ci/build-qemu-powernv.sh | 2 | ||||
-rwxr-xr-x | opal-ci/build-ubuntu-16.04.sh | 6 | ||||
-rwxr-xr-x | opal-ci/build-ubuntu-18.04.sh | 4 | ||||
-rwxr-xr-x | test/hello_world/run_mambo_hello_world.sh | 8 | ||||
-rwxr-xr-x | test/hello_world/run_mambo_p9_hello_world.sh | 8 | ||||
-rwxr-xr-x | test/hello_world/run_qemu_hello_world.sh | 6 | ||||
-rwxr-xr-x | test/make-boot-coverage-report.sh | 2 | ||||
-rwxr-xr-x | test/run_mambo_boot_test.sh | 6 | ||||
-rwxr-xr-x | test/run_qemu-jessie-debian-installer_boot_test.sh | 8 | ||||
-rwxr-xr-x | test/run_qemu_boot_test.sh | 8 | ||||
-rwxr-xr-x | test/sreset_world/run_mambo_p9_sreset.sh | 8 | ||||
-rwxr-xr-x | test/sreset_world/run_mambo_sreset.sh | 8 |
17 files changed, 51 insertions, 51 deletions
diff --git a/libstb/sign-with-local-keys.sh b/libstb/sign-with-local-keys.sh index efddabff..b78a079b 100755 --- a/libstb/sign-with-local-keys.sh +++ b/libstb/sign-with-local-keys.sh @@ -11,7 +11,7 @@ fi KEYLOC=$3 LABEL=$4 -T=`mktemp -d` +T=$(mktemp -d) LABEL_ARG="" if [ ! -z "$LABEL" ]; then LABEL_ARG="-L $LABEL" diff --git a/make_offsets.sh b/make_offsets.sh index 34ba5f66..0c480be0 100755 --- a/make_offsets.sh +++ b/make_offsets.sh @@ -5,6 +5,6 @@ cat <<EOF #define ASM_OFFSETS_H /* Derived from $1 by make_offsets.sh */ -`grep '#define' $1` +$(grep '#define' $1) #endif /* ASM_OFFSETS_H */ EOF diff --git a/make_version.sh b/make_version.sh index c757e914..59fe01c7 100755 --- a/make_version.sh +++ b/make_version.sh @@ -14,14 +14,14 @@ fi if test -e .git || git rev-parse --is-inside-work-tree > /dev/null 2>&1; then - version=`git describe --exact-match 2>/dev/null` + version=$(git describe --exact-match 2>/dev/null) if [ -z "$version" ]; then - version=`git describe 2>/dev/null` + version=$(git describe 2>/dev/null) fi if [ -z "$version" ]; then - version=`git rev-parse --verify --short HEAD 2>/dev/null` + version=$(git rev-parse --verify --short HEAD 2>/dev/null) fi if [ ! -z "$EXTRA_VERSION" ]; then @@ -34,14 +34,14 @@ then version="$version-$USER" fi version="$version-dirty" - diffsha=`git diff|sha1sum` - diffsha=`cut -c-7 <<< "$diffsha"` + diffsha=$(git diff|sha1sum) + diffsha=$(cut -c-7 <<< "$diffsha") version="$version-$diffsha" fi if [ $# -eq 1 ]; then - version=`echo $version | sed s/skiboot/$1/` + version=$(echo $version | sed s/skiboot/$1/) fi echo $version diff --git a/opal-ci/build-centos7.sh b/opal-ci/build-centos7.sh index b1234b37..44733345 100755 --- a/opal-ci/build-centos7.sh +++ b/opal-ci/build-centos7.sh @@ -7,15 +7,15 @@ set -vx # We're limited as to what we want to bother to run on CentOS7 # It's fairly old and some of the things (e.g. build+run qemu) we don't # want to bother doing. -if [ `arch` == "x86_64" ]; then +if [ $(arch) == "x86_64" ]; then export CROSS=/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/powerpc64-linux- fi # Note that this doesn't work on centos7 because "/lib64/ld64.so.2: version `GLIBC_2.22' not found" -if [ `arch` == "ppc64le" ]; then +if [ $(arch) == "ppc64le" ]; then export CROSS=/opt/cross/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- fi -MAKE_J=`grep -c processor /proc/cpuinfo` +MAKE_J=$(grep -c processor /proc/cpuinfo) make -j${MAKE_J} all make -j${MAKE_J} check @@ -28,5 +28,5 @@ SKIBOOT_GCOV=1 make -j${MAKE_J} check make clean rm -rf builddir mkdir builddir -make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make SRC=$(pwd) -f ../Makefile -C builddir -j${MAKE_J} make clean diff --git a/opal-ci/build-fedora27.sh b/opal-ci/build-fedora27.sh index be082592..02ac4280 100755 --- a/opal-ci/build-fedora27.sh +++ b/opal-ci/build-fedora27.sh @@ -4,7 +4,7 @@ set -uo pipefail set -e set -vx -MAKE_J=`grep -c processor /proc/cpuinfo` +MAKE_J=$(grep -c processor /proc/cpuinfo) export CROSS="ccache powerpc64-linux-gnu-" make -j${MAKE_J} all @@ -21,5 +21,5 @@ make clean make clean rm -rf builddir mkdir builddir -make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make SRC=$(pwd) -f ../Makefile -C builddir -j${MAKE_J} make clean diff --git a/opal-ci/build-qemu-powernv.sh b/opal-ci/build-qemu-powernv.sh index 58a89778..5c61aa72 100755 --- a/opal-ci/build-qemu-powernv.sh +++ b/opal-ci/build-qemu-powernv.sh @@ -8,4 +8,4 @@ git submodule update --init dtc export CC="ccache gcc" export CXX="ccache g++" ./configure --target-list=ppc64-softmmu --disable-werror -make -j `grep -c processor /proc/cpuinfo` +make -j $(grep -c processor /proc/cpuinfo) diff --git a/opal-ci/build-ubuntu-16.04.sh b/opal-ci/build-ubuntu-16.04.sh index 053e7e2a..06a9b484 100755 --- a/opal-ci/build-ubuntu-16.04.sh +++ b/opal-ci/build-ubuntu-16.04.sh @@ -4,13 +4,13 @@ set -uo pipefail set -e set -vx -MAKE_J=`grep -c processor /proc/cpuinfo` +MAKE_J=$(grep -c processor /proc/cpuinfo) export CROSS="ccache powerpc64le-linux-gnu-" make -j${MAKE_J} all (cd opal-ci; ./build-qemu-powernv.sh) -export QEMU_BIN=`pwd`/opal-ci/qemu/ppc64-softmmu/qemu-system-ppc64 +export QEMU_BIN=$(pwd)/opal-ci/qemu/ppc64-softmmu/qemu-system-ppc64 ./opal-ci/fetch-debian-jessie-installer.sh make -j${MAKE_J} check (make clean; cd external/gard && CROSS= make -j${MAKE_J}) @@ -30,5 +30,5 @@ SKIBOOT_GCOV=1 make -j${MAKE_J} check make clean rm -rf builddir mkdir builddir -make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make SRC=$(pwd) -f ../Makefile -C builddir -j${MAKE_J} make clean diff --git a/opal-ci/build-ubuntu-18.04.sh b/opal-ci/build-ubuntu-18.04.sh index 7bcd2d50..2786600f 100755 --- a/opal-ci/build-ubuntu-18.04.sh +++ b/opal-ci/build-ubuntu-18.04.sh @@ -4,7 +4,7 @@ set -uo pipefail set -e set -vx -MAKE_J=`grep -c processor /proc/cpuinfo` +MAKE_J=$(grep -c processor /proc/cpuinfo) export CROSS="ccache powerpc64le-linux-gnu-" @@ -28,7 +28,7 @@ SKIBOOT_GCOV=1 make -j${MAKE_J} check make clean rm -rf builddir mkdir builddir -make SRC=`pwd` -f ../Makefile -C builddir -j${MAKE_J} +make SRC=$(pwd) -f ../Makefile -C builddir -j${MAKE_J} make clean echo "Building with clang..." diff --git a/test/hello_world/run_mambo_hello_world.sh b/test/hello_world/run_mambo_hello_world.sh index 13112d00..54d445b1 100755 --- a/test/hello_world/run_mambo_hello_world.sh +++ b/test/hello_world/run_mambo_hello_world.sh @@ -19,19 +19,19 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping hello_world test'; exit 0; fi if [ -n "$SKIBOOT_ENABLE_MAMBO_STB" ]; then - export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel.stb + export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel.stb else - export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel + export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel fi # Currently getting some core dumps from mambo, so disable them! -OLD_ULIMIT_C=`ulimit -c` +OLD_ULIMIT_C=$(ulimit -c) ulimit -c 0 t=$(mktemp) || exit 1 diff --git a/test/hello_world/run_mambo_p9_hello_world.sh b/test/hello_world/run_mambo_p9_hello_world.sh index f8b0dae8..9560527a 100755 --- a/test/hello_world/run_mambo_p9_hello_world.sh +++ b/test/hello_world/run_mambo_p9_hello_world.sh @@ -18,19 +18,19 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping hello_world test'; exit 0; fi if [ -n "$SKIBOOT_ENABLE_MAMBO_STB" ]; then - export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel.stb + export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel.stb else - export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel + export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel fi # Currently getting some core dumps from mambo, so disable them! -OLD_ULIMIT_C=`ulimit -c` +OLD_ULIMIT_C=$(ulimit -c) ulimit -c 0 t=$(mktemp) || exit 1 diff --git a/test/hello_world/run_qemu_hello_world.sh b/test/hello_world/run_qemu_hello_world.sh index 3f0aa55a..e8d31760 100755 --- a/test/hello_world/run_qemu_hello_world.sh +++ b/test/hello_world/run_qemu_hello_world.sh @@ -5,7 +5,7 @@ if [ -z "$QEMU_BIN" ]; then QEMU_BIN="qemu-system-ppc64" fi -if [ ! `command -v $QEMU_BIN` ]; then +if [ ! $(command -v $QEMU_BIN) ]; then echo "Could not find executable QEMU_BIN ($QEMU_BIN). Skipping hello_world test"; exit 0; fi @@ -15,13 +15,13 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping hello_world test'; exit 0; fi -export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel +export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel t=$(mktemp) || exit 1 diff --git a/test/make-boot-coverage-report.sh b/test/make-boot-coverage-report.sh index c4d5a0d0..210880ee 100755 --- a/test/make-boot-coverage-report.sh +++ b/test/make-boot-coverage-report.sh @@ -2,7 +2,7 @@ # We cheat and do this in a shell script so I don't go Makefile crazy. -SKIBOOT_GCOV_ADDR=`perl -e "printf '0x%x', 0x30000000 + 0x\`grep gcov_info_list skiboot.map|cut -f 1 -d ' '\`"` +SKIBOOT_GCOV_ADDR=$(perl -e "printf '0x%x', 0x30000000 + 0x$(grep gcov_info_list skiboot.map|cut -f 1 -d ' ')") LCOV_INFO_FILES="" diff --git a/test/run_mambo_boot_test.sh b/test/run_mambo_boot_test.sh index fe0be0e3..adff1804 100755 --- a/test/run_mambo_boot_test.sh +++ b/test/run_mambo_boot_test.sh @@ -19,13 +19,13 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping hello_world test'; exit 0; fi if [ -z "$SKIBOOT_ZIMAGE" ]; then - export SKIBOOT_ZIMAGE=`pwd`/zImage.epapr + export SKIBOOT_ZIMAGE=$(pwd)/zImage.epapr fi if [ ! -f "$SKIBOOT_ZIMAGE" ]; then @@ -38,7 +38,7 @@ if [ -z "$SKIBOOT_MEM_DUMP" ]; then fi # Currently getting some core dumps from mambo, so disable them! -OLD_ULIMIT_C=`ulimit -c` +OLD_ULIMIT_C=$(ulimit -c) ulimit -c 0 t=$(mktemp) || exit 1 diff --git a/test/run_qemu-jessie-debian-installer_boot_test.sh b/test/run_qemu-jessie-debian-installer_boot_test.sh index 63c4d299..652ca381 100755 --- a/test/run_qemu-jessie-debian-installer_boot_test.sh +++ b/test/run_qemu-jessie-debian-installer_boot_test.sh @@ -5,7 +5,7 @@ if [ -z "$QEMU_BIN" ]; then QEMU_BIN="qemu-system-ppc64" fi -if [ ! `command -v $QEMU_BIN` ]; then +if [ ! $(command -v $QEMU_BIN) ]; then echo "Could not find executable QEMU_BIN ($QEMU_BIN). Skipping hello_world test"; exit 0; fi @@ -15,7 +15,7 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping boot test'; exit 0; fi @@ -30,8 +30,8 @@ if [ ! -f debian-jessie-initrd.gz ]; then exit 0; fi -T=`mktemp --tmpdir skiboot_qemu_debian-jessie-boot_test.XXXXXXXXXX` -#D=`mktemp --tmpdir debian-jessie-install.qcow2.XXXXXXXXXX` +T=$(mktemp --tmpdir skiboot_qemu_debian-jessie-boot_test.XXXXXXXXXX) +#D=$(mktemp --tmpdir debian-jessie-install.qcow2.XXXXXXXXXX) # In future we should do full install: # FIXME: -append "DEBIAN_FRONTEND=text locale=en_US keymap=us hostname=OPALtest domain=unassigned-domain rescue/enable=true" diff --git a/test/run_qemu_boot_test.sh b/test/run_qemu_boot_test.sh index bfcf4851..08bb65aa 100755 --- a/test/run_qemu_boot_test.sh +++ b/test/run_qemu_boot_test.sh @@ -5,7 +5,7 @@ if [ -z "$QEMU_BIN" ]; then QEMU_BIN="qemu-system-ppc64" fi -if [ ! `command -v $QEMU_BIN` ]; then +if [ ! $(command -v $QEMU_BIN) ]; then echo "Could not find executable QEMU_BIN ($QEMU_BIN). Skipping hello_world test"; exit 0; fi @@ -15,13 +15,13 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping hello_world test'; exit 0; fi if [ -z "$SKIBOOT_ZIMAGE" ]; then - export SKIBOOT_ZIMAGE=`pwd`/zImage.epapr + export SKIBOOT_ZIMAGE=$(pwd)/zImage.epapr fi if [ ! -f "$SKIBOOT_ZIMAGE" ]; then @@ -29,7 +29,7 @@ if [ ! -f "$SKIBOOT_ZIMAGE" ]; then exit 0; fi -T=`mktemp --tmpdir skiboot_qemu_boot_test.XXXXXXXXXX` +T=$(mktemp --tmpdir skiboot_qemu_boot_test.XXXXXXXXXX) ( cat <<EOF | expect set timeout 600 diff --git a/test/sreset_world/run_mambo_p9_sreset.sh b/test/sreset_world/run_mambo_p9_sreset.sh index 9f61f1e9..926ce3e4 100755 --- a/test/sreset_world/run_mambo_p9_sreset.sh +++ b/test/sreset_world/run_mambo_p9_sreset.sh @@ -18,19 +18,19 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping sreset_world test'; exit 0; fi if [ -n "$SKIBOOT_ENABLE_MAMBO_STB" ]; then - export SKIBOOT_ZIMAGE=`pwd`/test/sreset_world/sreset_kernel/sreset_kernel.stb + export SKIBOOT_ZIMAGE=$(pwd)/test/sreset_world/sreset_kernel/sreset_kernel.stb else - export SKIBOOT_ZIMAGE=`pwd`/test/sreset_world/sreset_kernel/sreset_kernel + export SKIBOOT_ZIMAGE=$(pwd)/test/sreset_world/sreset_kernel/sreset_kernel fi # Currently getting some core dumps from mambo, so disable them! -OLD_ULIMIT_C=`ulimit -c` +OLD_ULIMIT_C=$(ulimit -c) ulimit -c 0 t=$(mktemp) || exit 1 diff --git a/test/sreset_world/run_mambo_sreset.sh b/test/sreset_world/run_mambo_sreset.sh index 10c7224d..8fba5eb9 100755 --- a/test/sreset_world/run_mambo_sreset.sh +++ b/test/sreset_world/run_mambo_sreset.sh @@ -19,19 +19,19 @@ if [ -n "$KERNEL" ]; then exit 0; fi -if [ ! `command -v expect` ]; then +if [ ! $(command -v expect) ]; then echo 'Could not find expect binary. Skipping sreset_world test'; exit 0; fi if [ -n "$SKIBOOT_ENABLE_MAMBO_STB" ]; then - export SKIBOOT_ZIMAGE=`pwd`/test/sreset_world/sreset_kernel/sreset_kernel.stb + export SKIBOOT_ZIMAGE=$(pwd)/test/sreset_world/sreset_kernel/sreset_kernel.stb else - export SKIBOOT_ZIMAGE=`pwd`/test/sreset_world/sreset_kernel/sreset_kernel + export SKIBOOT_ZIMAGE=$(pwd)/test/sreset_world/sreset_kernel/sreset_kernel fi # Currently getting some core dumps from mambo, so disable them! -OLD_ULIMIT_C=`ulimit -c` +OLD_ULIMIT_C=$(ulimit -c) ulimit -c 0 t=$(mktemp) || exit 1 |