File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # USAGE: Pass the output of `krun --dry-run` to this script on the command line.
4
+
5
+ set_results () {
6
+ last_result=" result-$( printf " %04d" $last ) .kore"
7
+ next_result=" result-$( printf " %04d" $next ) .kore"
8
+ }
9
+ (( last = 0 ))
10
+ (( next = 1 ))
11
+ set_results
12
+
13
+ kore_exec_args=()
14
+ while [[ $# -gt 0 ]]
15
+ do
16
+ case " $1 " in
17
+ --pattern)
18
+ pattern=" $2 "
19
+ shift
20
+ ;;
21
+ --output)
22
+ shift
23
+ ;;
24
+ --depth)
25
+ depth=" $2 "
26
+ shift
27
+ ;;
28
+ * )
29
+ kore_exec_args+=(" $1 " )
30
+ esac
31
+ shift
32
+ done
33
+
34
+ if [[ -z " $pattern " ]]
35
+ then
36
+ echo >&2 " Error: Missing --pattern FILENAME argument"
37
+ exit 1
38
+ fi
39
+ last_result=" $pattern "
40
+ csv_file=" $pattern .csv"
41
+
42
+ trap ' exit 1' SIGINT
43
+
44
+ while [[ -z " $depth " ]] || [[ " $last " -lt " $depth " ]]
45
+ do
46
+ command time -f ' %S,%U,%M' -o " ${csv_file:? } " -a -q \
47
+ kore-exec " ${kore_exec_args[@]} " \
48
+ --pattern " ${last_result:? } " --output " ${next_result:? } " --depth 1
49
+ if diff " $last_result " " $next_result " > /dev/null; then break ; fi
50
+ (( last = next ))
51
+ (( next += 1 ))
52
+ set_results
53
+ done
You can’t perform that action at this time.
0 commit comments