Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/woip/sh/scan
diff options
context:
space:
mode:
Diffstat (limited to 'woip/sh/scan')
-rwxr-xr-xwoip/sh/scan28
1 files changed, 28 insertions, 0 deletions
diff --git a/woip/sh/scan b/woip/sh/scan
new file mode 100755
index 0000000..3a49d44
--- /dev/null
+++ b/woip/sh/scan
@@ -0,0 +1,28 @@
+#!/bin/zsh
+# print bz2 debug info for given file in roundabout fashion
+
+file=$1
+ftmp="/tmp/$$.tmp"
+otmp="/tmp/$$.o.tmp"
+
+if [ ! -n "$1" ]; then
+ echo "scan <file>" >/dev/stdout
+ exit -1
+fi
+
+if [ -n "$2" ]; then
+ arg=$2
+else
+ arg="2>/dev/null"
+fi
+
+../c/bzipreader -f $file -l > $ftmp
+
+I=-1; while [ $((I++)) -lt 10 ];
+do
+ offset=`cat $ftmp | grep -E "^$I" | awk '{print $2;}'`
+ echo -n "$I\t$offset\t"
+ eval "../c/bzipreader -f $file -n $I -x $arg > $otmp"
+ cat $otmp | head | tr "\n" "\\" | head -c 30
+ echo "" `cat $otmp | wc -c`
+done