Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/wasm/split-speedtest1-script.sh # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / wasm / split-speedtest1-script.sh` 17 lines ยท 615 bytes Raw Blame History 1 #!/bin/bash 2 # Expects $1 to be a (speedtest1 --script) output file. Output is a 3 # series of SQL files extracted from that file. 4 infile=${1:?arg = speedtest1 --script output file} 5 testnums=$(grep -e '^-- begin test' "$infile" | cut -d' ' -f4) 6 if [ x = "x${testnums}" ]; then 7 echo "Could not parse any begin/end blocks out of $infile" 1>&2 8 exit 1 9 fi 10 odir=${infile%%/*} 11 if [ "$odir" = "$infile" ]; then odir="."; fi 12 #echo testnums=$testnums 13 for n in $testnums; do 14 ofile=$odir/$(printf "speedtest1-%03d.sql" $n) 15 sed -n -e "/^-- begin test $n /,/^-- end test $n\$/p" $infile > $ofile 16 echo -e "$n\t$ofile" 17 done