argtype 284 B

123456789101112131415
  1. #!/bin/sh
  2. : argtype lists all em mnemonics that have an argument type equal to
  3. : one of the letters specified in the argument
  4. case x$# in
  5. x2)
  6. ;;
  7. x*) echo "Usage: $0 argtypes <em_table>" 1>&2
  8. exit 1
  9. ;;
  10. esac
  11. ed -s $2 << A
  12. 1,/^\$/d
  13. 1,/^\$/d
  14. 1,/^\$/g/^\(...\) [$1].*/s//\\1/gp
  15. A