blob: 885abe222d6408e15c9dcb9ef4c47e68f8890c65 [file] [log] [blame]
blueswir15824d652009-03-28 06:44:27 +00001#!/bin/sh
2
3hxtoh()
4{
5 flag=1
blueswir1fb21ced2009-03-29 09:06:43 +00006 while read -r str; do
blueswir15824d652009-03-28 06:44:27 +00007 case $str in
8 HXCOMM*)
9 ;;
10 STEXI*|ETEXI*) flag=$(($flag^1))
11 ;;
12 *)
blueswir1004efc92009-03-29 10:50:43 +000013 test $flag -eq 1 && printf "%s\n" "$str"
blueswir15824d652009-03-28 06:44:27 +000014 ;;
15 esac
16 done
17}
18
19hxtotexi()
20{
21 flag=0
blueswir1fb21ced2009-03-29 09:06:43 +000022 while read -r str; do
blueswir15824d652009-03-28 06:44:27 +000023 case "$str" in
24 HXCOMM*)
25 ;;
26 STEXI*|ETEXI*) flag=$(($flag^1))
27 ;;
28 DEFHEADING*)
29 echo $(expr "$str" : "DEFHEADING(\(.*\))")
30 ;;
31 *)
32 test $flag -eq 1 && echo $str
33 ;;
34 esac
35 done
36}
37
38case "$1" in
39"-h") hxtoh ;;
40"-t") hxtotexi ;;
41*) exit 1 ;;
42esac
blueswir15c2f8d22009-03-28 08:13:56 +000043
44exit 0