diff options
Diffstat (limited to 'ext/wasm/split-speedtest1-script.sh')
-rwxr-xr-x | ext/wasm/split-speedtest1-script.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/wasm/split-speedtest1-script.sh b/ext/wasm/split-speedtest1-script.sh index c7dae3eb6..e228a872e 100755 --- a/ext/wasm/split-speedtest1-script.sh +++ b/ext/wasm/split-speedtest1-script.sh @@ -3,9 +3,13 @@ # series of SQL files extracted from that file. infile=${1:?arg = speedtest1 --script output file} testnums=$(grep -e '^-- begin test' "$infile" | cut -d' ' -f4) +if [ x = "x${testnums}" ]; then + echo "Could not parse any begin/end blocks out of $infile" 1>&2 + exit 1 +fi #echo testnums=$testnums for n in $testnums; do ofile=$(printf "speedtest1-%03d.sql" $n) - sed -n -e "/^-- begin test $n\$/,/^-- end test $n\$/p" $infile > $ofile + sed -n -e "/^-- begin test $n /,/^-- end test $n\$/p" $infile > $ofile echo -e "$n\t$ofile" done |