2009-03-28 09:44:27 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
hxtoh()
|
|
|
|
{
|
|
|
|
flag=1
|
|
|
|
while read str; do
|
|
|
|
case $str in
|
|
|
|
HXCOMM*)
|
|
|
|
;;
|
|
|
|
STEXI*|ETEXI*) flag=$(($flag^1))
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
test $flag -eq 1 && echo $str
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
hxtotexi()
|
|
|
|
{
|
|
|
|
flag=0
|
|
|
|
while read str; do
|
|
|
|
case "$str" in
|
|
|
|
HXCOMM*)
|
|
|
|
;;
|
|
|
|
STEXI*|ETEXI*) flag=$(($flag^1))
|
|
|
|
;;
|
|
|
|
DEFHEADING*)
|
|
|
|
echo $(expr "$str" : "DEFHEADING(\(.*\))")
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
test $flag -eq 1 && echo $str
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
"-h") hxtoh ;;
|
|
|
|
"-t") hxtotexi ;;
|
|
|
|
*) exit 1 ;;
|
|
|
|
esac
|
2009-03-28 11:13:56 +03:00
|
|
|
|
|
|
|
exit 0
|