hxtool 342 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. hxtoh()
  3. {
  4. flag=1
  5. while read -r str; do
  6. case $str in
  7. HXCOMM*)
  8. ;;
  9. SRST*|ERST*) flag=$(($flag^1))
  10. ;;
  11. *)
  12. test $flag -eq 1 && printf "%s\n" "$str"
  13. ;;
  14. esac
  15. done
  16. }
  17. case "$1" in
  18. "-h") hxtoh ;;
  19. *) exit 1 ;;
  20. esac < "$2"
  21. exit 0