Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PACKET_SIZE=1000
- SIM_TIME=10.5
- BANDWITH=1048576
- for i in {1..20}
- do
- a=$(cat csmacd$i.tr | grep "^r" -c)
- tp=$(bc <<< "scale = 5; (($a * $PACKET_SIZE) / $SIM_TIME)")
- eff=$(bc <<< "scale = 5; (($tp * 8) / $BANDWITH)")
- perd=$(cat csmacd$i.tr | grep "^d" -c)
- echo "Simulación $i" >> trcompute_output.txt
- echo "Eficiencia: $(bc <<< "scale = 5; ($eff * 100)")%" >> trcompute_output.txt
- echo "Throughput: $tp bytes/s" >> trcompute_output.txt
- echo "Perdidas: $perd paquetes" >> trcompute_output.txt
- echo "--------------------------" >> trcompute_output.txt
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement