From 23d8c556848c8121e50ff77b16254f1802aa681a Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Wed, 3 Feb 2016 23:44:42 +0100 Subject: tests: minor cleanup ts_fdisk_clean() Signed-off-by: Ruediger Meier --- tests/functions.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index 1f4d51878..8f6c87724 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -610,18 +610,18 @@ function ts_fdisk_clean { local DEVNAME=$1 # remove non comparable parts of fdisk output - if [ x"${DEVNAME}" != x"" ]; then - sed -i -e "s:${DEVNAME}::g;" $TS_OUTPUT - fi - - sed -i -e 's/Disk identifier:.*/Disk identifier: /g' \ - -e 's/Created a new.*/Created a new ./g' \ - -e 's/^Device[[:blank:]]*Start/Device Start/g' \ - -e 's/^Device[[:blank:]]*Boot/Device Boot/g' \ - -e 's/^Device[[:blank:]]*Flag/Device Flag/g' \ - -e 's/Welcome to fdisk.*/Welcome to fdisk ./g' \ - -e 's/typescript file.*/typescript file ./g' \ - $TS_OUTPUT + if [ -n "${DEVNAME}" ]; then + sed -i -e "s@${DEVNAME}@@;" $TS_OUTPUT + fi + + sed -i \ + -e 's/Disk identifier:.*/Disk identifier: /' \ + -e 's/Created a new.*/Created a new ./' \ + -e 's/^Device[[:blank:]]*Start/Device Start/' \ + -e 's/^Device[[:blank:]]*Boot/Device Boot/' \ + -e 's/Welcome to fdisk.*/Welcome to fdisk ./' \ + -e 's/typescript file.*/typescript file ./' \ + $TS_OUTPUT } function ts_scsi_debug_init { -- cgit v1.2.3-55-g7522