-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataExtraction_guardTime.sh
executable file
·41 lines (34 loc) · 2.1 KB
/
dataExtraction_guardTime.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
#!/bin/bash
rm *.txt
echo "removing files *.txt"
for i in $(seq 20 5 80)
do
echo "start of simulation with ROV period $i"
ns $1 $i>> my_log.txt
grep -Po 'x = ([-0-9.\n]*[,]*)' $2 | grep -o '[-0-9.]*' >> x$i.txt
grep -Po 'y = ([-0-9.\n]*[,]*)' $2 | grep -o '[-0-9.]*' >> y$i.txt
grep -Po 'z = ([-0-9.\n]*[,]*)' $2 | grep -o '[-0-9.]*' >> z$i.txt
grep -io 'applicationROV Throughput[ ]* : [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'applicationROV PER[ ]* : [-0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'applicationCTR Throughput[ ]* : [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'applicationCTR PER[ ]* : [-0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -io 'Sent Packets CTR --> ROV[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'Sent Packets ROV --> CTR[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'Received Packets ROV --> CTR[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'Received Packets CTR --> ROV[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -io 'guard time waypoint[ ]*: [0-9]*' my_log.txt | grep -io [0-9]* >> data$i.txt
grep -i 'ROV packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'ROV std packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'CTR packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'CTR std packet delivery delay' my_log.txt | grep -io [0-9.]* >> data$i.txt
grep -i 'adaptive' my_log.txt | grep -io [0-9] >> data$i.txt
grep -i 'constant' my_log.txt | grep -io [0-9] >> data$i.txt
grep -i 'opt(send_ack_immediately)' my_log.txt | grep -io [0-9] >> data$i.txt
grep -i 'CTR round trip time[ ]*: [0-9.]*' my_log.txt | grep -io [0-9.]* >> data$i.txt
cp ./x$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
cp ./y$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
cp ./z$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
cp ./data$i.txt /media/sf_VirtualMachine/Project_Simulation/matlab
rm my_log.txt
echo "end of simulation with ROV period $i"
done