-
Notifications
You must be signed in to change notification settings - Fork 1
/
parse_result.sh
executable file
·65 lines (56 loc) · 1.35 KB
/
parse_result.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh#
cat $1 | sed '/^[a-z]/ d' | sed '/^\ / d' | sed '/^\-/ d' |
sed '/^Black\-Scholes/ d' |
sed '/^Trials/ d' |
sed '/^Confidence/ d' |
sed '/^Average/ d' |
sed '/^Standard/ d' |
sed 's/(.*)//g' |
if [ $# -eq 1 ]; then
sed 's/Total[a-zA-Z ]*/Total/g' |
sed 's/PRNG[a-zA-Z ]*/PRNG/g' |
sed 's/BS[a-zA-Z ]*/BS/g'
else
# print total only
if [ $2 -eq 0 ] ; then
sed 's/Total[a-zA-Z ]*/Total/g' |
sed '/^PRNG/ d' |
sed '/^BS/ d'
fi
# print PRNG only
if [ $2 -eq 1 ] ; then
sed '/^Total/ d' |
sed '/^BS/ d' |
sed 's/PRNG[a-zA-Z ]*/PRNG/g'
fi
#print BS only
if [ $2 -eq 2 ] ; then
sed '/^Total/ d' |
sed '/^PRNG/ d' |
sed 's/BS[a-zA-Z ]*/BS/g'
fi
fi
#sed 's/(.*)//g' |
# sed '/^Total/ d' |
#sed 's/Total[a-zA-Z ]*/Total/g' |
# sed '/^PRNG/ d' |
#sed 's/PRNG[a-zA-Z ]*/PRNG/g' |
# sed '/^BS/ d'
#sed 's/BS[a-zA-Z ]*/BS/g'
#declare -a ARRAY
#Link filedescriptor 10 with stdin
#exec 10<&0
# stdin replaced with a file supplied as a first argument
#exec < $1
#let count=0
#while read LINE; do
# ARRAY[$count]=$LINE
# ((count++))
# echo ${ARRAY[count]}
#done
# echo Number of elements: ${#ARRAY[@]}
#echo ${ARRAY[@]}
#echo count = $count
# restore stdin from filedescriptor 10
# and close filedescriptor 10
#exec 0<&10 10<&-