File: maketable.sh

package info (click to toggle)
libdsiutils-java 2.7.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,956 kB
  • sloc: java: 33,461; xml: 407; makefile: 51; sh: 50
file content (13 lines) | stat: -rwxr-xr-x 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

# Takes the output of RandomSpeed and generates lines for an HTML table

repeats=4
numgens=5

tot=$(grep "ThreadLocalRandom.next" $1 | cut -d. -f2 | wc -l)
n=$((tot/repeats))

paste <(for((i=0; i<n; i++)); do echo " * <TR><TD>"; done) \
		<(grep "ThreadLocalRandom.next" $1 | cut -d. -f3 | tail -n $n) \
		<(egrep -o "[0-9.]+ ns"  $1 | cut -d' ' -f1 | tail -n $((n*numgens)) | awk "{ printf(\"<TD>%s\", \$0); i = i + 1; if ( i % $numgens == 0 ) printf \"\\n\"; }")