sewardj | ebf67cc | 2005-05-24 14:46:02 +0000 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | |
| 3 | ./filter_stderr | |
| 4 | sed "s/<tid>[0-9]*<\/tid>/<tid>...<\/tid>/" | |
| 5 | sed "s/<pid>[0-9]*<\/pid>/<pid>...<\/pid>/" | |
| 6 | sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | |
| 7 | sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" | |
sewardj | e5f98d9 | 2005-06-15 21:34:35 +0000 | [diff] [blame] | 8 | sed "s/<line>.*<\/line>/<line>...<\/line>/" | |
sewardj | 3d7bb54 | 2005-07-02 20:41:25 +0000 | [diff] [blame] | 9 | sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" | |
| 10 | sed "s/<count>.*<\/count>/<count>...<\/count>/" | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 11 | sed "s/\(m_replacemalloc\/\)\?vg_replace_malloc.c/vg_replace_malloc.c/" | |
njn | 483398e | 2005-07-20 03:03:44 +0000 | [diff] [blame] | 12 | perl -0 -p -e "s/<suppcounts>.*<\/suppcounts>/<suppcounts>...<\/suppcounts>/s" | |
sewardj | 33e6042 | 2005-07-24 07:33:15 +0000 | [diff] [blame] | 13 | perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" | |
njn | 483398e | 2005-07-20 03:03:44 +0000 | [diff] [blame] | 14 | perl -0 -p -e "s/<vargv>.*<\/vargv>/<vargv>...<\/vargv>/s" |
sewardj | 3d7bb54 | 2005-07-02 20:41:25 +0000 | [diff] [blame] | 15 | |
| 16 | # Collected wisdom re Perl magic incantation: |
| 17 | # |
| 18 | # From: Tom Hughes |
| 19 | # |
| 20 | # Two problems - one is that you need -p to force perl to loop over |
| 21 | # the input lines and apply your expression to each one and then print |
| 22 | # the results. |
| 23 | # |
| 24 | # The other is that as somebody else said you need to change the input |
| 25 | # record separator so that it reads in the whole file as a single line |
njn | ac31b05 | 2009-02-12 00:30:02 +0000 | [diff] [blame^] | 26 | # (which means we can do multi-line matching in a single regexp) which you |
| 27 | # can do with the -0 switch. |
sewardj | 3d7bb54 | 2005-07-02 20:41:25 +0000 | [diff] [blame] | 28 | # |
| 29 | # Hence -0 -p. |