root / hxtool @ dd4239d6
History | View | Annotate | Download (720 Bytes)
1 | 5824d651 | blueswir1 | #!/bin/sh |
---|---|---|---|
2 | 5824d651 | blueswir1 | |
3 | 5824d651 | blueswir1 | hxtoh() |
4 | 5824d651 | blueswir1 | { |
5 | 5824d651 | blueswir1 | flag=1 |
6 | fb21ced7 | blueswir1 | while read -r str; do |
7 | 5824d651 | blueswir1 | case $str in |
8 | 5824d651 | blueswir1 | HXCOMM*) |
9 | 5824d651 | blueswir1 | ;; |
10 | 5824d651 | blueswir1 | STEXI*|ETEXI*) flag=$(($flag^1)) |
11 | 5824d651 | blueswir1 | ;; |
12 | 5824d651 | blueswir1 | *) |
13 | 004efc96 | blueswir1 | test $flag -eq 1 && printf "%s\n" "$str" |
14 | 5824d651 | blueswir1 | ;; |
15 | 5824d651 | blueswir1 | esac |
16 | 5824d651 | blueswir1 | done |
17 | 5824d651 | blueswir1 | } |
18 | 5824d651 | blueswir1 | |
19 | 5824d651 | blueswir1 | hxtotexi() |
20 | 5824d651 | blueswir1 | { |
21 | 5824d651 | blueswir1 | flag=0 |
22 | fb21ced7 | blueswir1 | while read -r str; do |
23 | 5824d651 | blueswir1 | case "$str" in |
24 | 5824d651 | blueswir1 | HXCOMM*) |
25 | 5824d651 | blueswir1 | ;; |
26 | 5824d651 | blueswir1 | STEXI*|ETEXI*) flag=$(($flag^1)) |
27 | 5824d651 | blueswir1 | ;; |
28 | 5824d651 | blueswir1 | DEFHEADING*) |
29 | 7d69c52e | Stefan Weil | echo "$(expr "$str" : "DEFHEADING(\(.*\))")" |
30 | 5824d651 | blueswir1 | ;; |
31 | 5824d651 | blueswir1 | *) |
32 | 7d69c52e | Stefan Weil | test $flag -eq 1 && echo "$str" |
33 | 5824d651 | blueswir1 | ;; |
34 | 5824d651 | blueswir1 | esac |
35 | 5824d651 | blueswir1 | done |
36 | 5824d651 | blueswir1 | } |
37 | 5824d651 | blueswir1 | |
38 | 5824d651 | blueswir1 | case "$1" in |
39 | 5824d651 | blueswir1 | "-h") hxtoh ;; |
40 | 5824d651 | blueswir1 | "-t") hxtotexi ;; |
41 | 5824d651 | blueswir1 | *) exit 1 ;; |
42 | 5824d651 | blueswir1 | esac |
43 | 5c2f8d2d | blueswir1 | |
44 | 5c2f8d2d | blueswir1 | exit 0 |