aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/beautify_log.sh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-03-22 02:58:20 +0000
committerBart Polot <bart@net.in.tum.de>2014-03-22 02:58:20 +0000
commit000c31c37814757424ee0583c49d6583d2b29231 (patch)
tree21a5863e4d5b884b15c2b8bfcdb1a43fe8347d76 /src/mesh/beautify_log.sh
parent28cecb117cc5755101afb0f7ec8de06210b1eea2 (diff)
downloadgnunet-000c31c37814757424ee0583c49d6583d2b29231.tar.gz
gnunet-000c31c37814757424ee0583c49d6583d2b29231.zip
- simplify, improve to 15000 lines/s
Diffstat (limited to 'src/mesh/beautify_log.sh')
-rwxr-xr-xsrc/mesh/beautify_log.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesh/beautify_log.sh b/src/mesh/beautify_log.sh
index a4d901643..b12f20380 100755
--- a/src/mesh/beautify_log.sh
+++ b/src/mesh/beautify_log.sh
@@ -1,19 +1,17 @@
1#!/bin/sh 1#!/bin/sh
2cp log .log 2grep "STARTING SERVICE " log > __tmp_peers
3cat .log | grep "STARTING SERVICE " > __tmp_peers 3SED_EXPR=""
4SED_EXPR="a"
5while read -r line; do 4while read -r line; do
6 PEER=`echo $line | sed -e 's/.*\[\(....\)\].*/\1/'` 5 PEER=`echo $line | sed -e 's/.*\[\(....\)\].*/\1/'`
7 PID=`echo $line | sed -e 's/.*mesh-\([0-9]*\).*/\1/'` 6 PID=`echo $line | sed -e 's/.*mesh-\([0-9]*\).*/\1/'`
8 echo "$PID => $PEER" 7 echo "$PID => $PEER"
9 export SED_EXPR="${SED_EXPR}s/mesh-\([a-z2]*\)-$PID/MESH \1 $PEER/;" 8 SED_EXPR="${SED_EXPR}s/mesh-\([a-z2]*\)-$PID/MESH \1 $PEER/;"
10 export SED_EXPR="${SED_EXPR}s/mesh-$PID/MESH XXX $PEER/" 9 SED_EXPR="${SED_EXPR}s/mesh-$PID/MESH XXX $PEER/;"
11done < __tmp_peers 10done < __tmp_peers
12rm __tmp_peers 11rm __tmp_peers
13 12
14SED_EXPR="${SED_EXPR}s/mesh-api-/mesh-api- /g" 13SED_EXPR="${SED_EXPR}s/mesh-api-/mesh-api- /g"
15cat .log | sed -e "$SED_EXPR" > .log2 14sed -e "$SED_EXPR" log > .log
16mv .log2 .log
17 15
18if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" ]]; then 16if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" ]]; then
19 kwrite .log --geometry 960x1140-960 & 17 kwrite .log --geometry 960x1140-960 &