diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-03-22 02:58:20 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-03-22 02:58:20 +0000 |
commit | 000c31c37814757424ee0583c49d6583d2b29231 (patch) | |
tree | 21a5863e4d5b884b15c2b8bfcdb1a43fe8347d76 /src/mesh/beautify_log.sh | |
parent | 28cecb117cc5755101afb0f7ec8de06210b1eea2 (diff) | |
download | gnunet-000c31c37814757424ee0583c49d6583d2b29231.tar.gz gnunet-000c31c37814757424ee0583c49d6583d2b29231.zip |
- simplify, improve to 15000 lines/s
Diffstat (limited to 'src/mesh/beautify_log.sh')
-rwxr-xr-x | src/mesh/beautify_log.sh | 12 |
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 |
2 | cp log .log | 2 | grep "STARTING SERVICE " log > __tmp_peers |
3 | cat .log | grep "STARTING SERVICE " > __tmp_peers | 3 | SED_EXPR="" |
4 | SED_EXPR="a" | ||
5 | while read -r line; do | 4 | while 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/;" |
11 | done < __tmp_peers | 10 | done < __tmp_peers |
12 | rm __tmp_peers | 11 | rm __tmp_peers |
13 | 12 | ||
14 | SED_EXPR="${SED_EXPR}s/mesh-api-/mesh-api- /g" | 13 | SED_EXPR="${SED_EXPR}s/mesh-api-/mesh-api- /g" |
15 | cat .log | sed -e "$SED_EXPR" > .log2 | 14 | sed -e "$SED_EXPR" log > .log |
16 | mv .log2 .log | ||
17 | 15 | ||
18 | if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" ]]; then | 16 | if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" ]]; then |
19 | kwrite .log --geometry 960x1140-960 & | 17 | kwrite .log --geometry 960x1140-960 & |