diff options
author | Tim Chase <[email protected]> | 2018-01-03 15:45:35 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-04-13 18:03:58 -0700 |
commit | 5c596ba7a47942f42aa7b67509cf28ebb878d058 (patch) | |
tree | d539f00030982c27a8e3c2105c686e3fd0f74132 /scripts | |
parent | 93b43af10df815d3ebfe136d03cd2d7f35350470 (diff) |
Eliminate trailing spaces in DISKS
The zfs-tests.sh driver script could add spaces to the end of $DISKS
which defeates shell-based parsing with constructs such as ${DISKS##* }.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Issue #6900
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/zfs-tests.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh index 38b01b871..22ca31d61 100755 --- a/scripts/zfs-tests.sh +++ b/scripts/zfs-tests.sh @@ -505,7 +505,11 @@ if [ -z "${DISKS}" ]; then [ -f "$TEST_FILE" ] && fail "Failed file exists: ${TEST_FILE}" truncate -s "${FILESIZE}" "${TEST_FILE}" || fail "Failed creating: ${TEST_FILE} ($?)" - DISKS="$DISKS$TEST_FILE " + if [[ "$DISKS" ]]; then + DISKS="$DISKS $TEST_FILE" + else + DISKS="$TEST_FILE" + fi done # @@ -522,7 +526,11 @@ if [ -z "${DISKS}" ]; then fail "Failed: ${TEST_FILE} -> ${TEST_LOOPBACK}" LOOPBACKS="${LOOPBACKS}${TEST_LOOPBACK} " BASELOOPBACKS=$(basename "$TEST_LOOPBACK") - DISKS="$DISKS$BASELOOPBACKS " + if [[ "$DISKS" ]]; then + DISKS="$DISKS $BASELOOPBACKS" + else + DISKS="$BASELOOPBACKS" + fi done fi fi |