diff --git a/board/qemu/post-image.sh b/board/qemu/post-image.sh index 57306dd546..ccd0fb78c9 100755 --- a/board/qemu/post-image.sh +++ b/board/qemu/post-image.sh @@ -1,8 +1,8 @@ #!/bin/bash -QEMU_BOARD_DIR="$(dirname $0)" -DEFCONFIG_NAME="$(basename $2)" -README_FILES="${QEMU_BOARD_DIR}/*/readme.txt" +QEMU_BOARD_DIR="$(dirname "$0")" +DEFCONFIG_NAME="$(basename "$2")" +README_FILE="${QEMU_BOARD_DIR}/*/readme.txt" START_QEMU_SCRIPT="${BINARIES_DIR}/start-qemu.sh" if [[ "${DEFCONFIG_NAME}" =~ ^"qemu_*" ]]; then @@ -12,7 +12,7 @@ fi # Search for "# qemu_*_defconfig" tag in all readme.txt files. # Qemu command line on multilines using back slash are accepted. -QEMU_CMD_LINE=$(sed -r ':a; /\\$/N; s/\\\n//; s/\t/ /; ta; /# '${DEFCONFIG_NAME}'$/!d; s/#.*//' ${README_FILES}) +QEMU_CMD_LINE="$(sed -r ':a; /\\$/N; s/\\\n//; s/\t/ /; ta; /# '"${DEFCONFIG_NAME}"'$/!d; s/#.*//' \ "${README_FILE}")" if [ -z "${QEMU_CMD_LINE}" ]; then # No Qemu cmd line found, can't test.