diff --git a/bin/pt-summary b/bin/pt-summary index c1544dcd..5e26d977 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -161,7 +161,7 @@ parse_proc_cpuinfo () { name_val "Speeds" "$(group_concat "$file.unq")" awk -F: '/model name/{print $2}' $file \ - | sort | uniq -c > "$file-2" + | sort | uniq -c > "$file.unq" name_val "Models" "$(group_concat "$file.unq")" awk -F: '/cache size/{print $2}' $file \ @@ -348,19 +348,19 @@ parse_filesystems () { local file=$1 local platform=$2 - local spec=$(awk ' + local spec=$(awk " BEGIN { device = 10; fstype = 4; options = 4; } /./ { - f_device = $1; - f_fstype = $10; - f_options = substr($11, 2, length($11) - 2); - if ( "$2" == "FreeBSD" ) { - f_fstype = substr($9, 2, length($9) - 2); - f_options = substr($0, index($0, ",") + 2); + f_device = \$1; + f_fstype = \$10; + f_options = substr(\$11, 2, length(\$11) - 2); + if ( \"$2\" == \"FreeBSD\" ) { + f_fstype = substr(\$9, 2, length(\$9) - 2); + f_options = substr(\$0, index(\$0, \",\") + 2); f_options = substr(f_options, 1, length(f_options) - 1); } if ( length(f_device) > device ) { @@ -374,9 +374,9 @@ parse_filesystems () { } } END{ - print "%-" device "s %5s %4s %-" fstype "s %-" options "s %s"; + print \"%-\" device \"s %5s %4s %-\" fstype \"s %-\" options \"s %s\"; } - ' $file) + " $file) awk " BEGIN { diff --git a/t/pt-summary/parse_raid_controller_lspci.sh b/t/pt-summary/parse_raid_controller_lspci.sh index 94c5f0a1..2da1395a 100644 --- a/t/pt-summary/parse_raid_controller_lspci.sh +++ b/t/pt-summary/parse_raid_controller_lspci.sh @@ -3,35 +3,35 @@ TEST=5 TEST_NAME="lspci-001.txt" -< $TMPDIR/expected +cat < $TMPDIR/expected Fusion-MPT SAS EOF parse_raid_controller_lspci samples/lspci-001.txt > $TMPDIR/got no_diff $TMPDIR/got $TMPDIR/expected TEST_NAME="lspci-002.txt" -< $TMPDIR/expected +cat < $TMPDIR/expected LSI Logic Unknown EOF parse_raid_controller_lspci samples/lspci-002.txt > $TMPDIR/got no_diff $TMPDIR/got $TMPDIR/expected TEST_NAME="lspci-003.txt" -< $TMPDIR/expected +cat < $TMPDIR/expected AACRAID EOF parse_raid_controller_lspci samples/lspci-003.txt > $TMPDIR/got no_diff $TMPDIR/got $TMPDIR/expected TEST_NAME="lspci-004.txt" -< $TMPDIR/expected +cat < $TMPDIR/expected LSI Logic MegaRAID SAS EOF parse_raid_controller_lspci samples/lspci-004.txt > $TMPDIR/got no_diff $TMPDIR/got $TMPDIR/expected TEST_NAME="lspci-006.txt" -< $TMPDIR/expected +cat < $TMPDIR/expected HP Smart Array EOF parse_raid_controller_lspci samples/lspci-006.txt > $TMPDIR/got diff --git a/util/test-bash-functions b/util/test-bash-functions index 5941aae1..1ffb0075 100755 --- a/util/test-bash-functions +++ b/util/test-bash-functions @@ -82,7 +82,7 @@ run_test() { local t_dir=$(dirname $t) TEST_FILE=$(basename $t) cd $t_dir - source $TEST_FILE + source ./$TEST_FILE cd $cwd return $?