mktapers.sh 727 B

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/ksh
  2. #
  3. # usage: mktapers.sh <taper>
  4. #
  5. # where taper has the form <arrowheadattr>_<dirattr>.fmt
  6. # where .fmt gives the desired output format.
  7. if (( $# == 0 ))
  8. then
  9. echo "mktapers: missing taper name argument"
  10. exit 1
  11. fi
  12. TGT=$1 # ah_dir.fmt
  13. TAPER=${1%.*} # ah_dir
  14. FMT=${1#$TAPER.} # fmt
  15. F=$TAPER.gv # ah_dir.gv
  16. AH=${TAPER%_*} # ah
  17. DIR=${TAPER#${AH}_} # dir
  18. exec 3> $F
  19. echo "digraph G { rankdir=LR ranksep=1 " >&3
  20. echo " edge [style=tapered penwidth=7 arrowtail=none ]" >&3
  21. echo " node[ style=filled label=\"\" ]" >&3
  22. echo " a -> b [ dir=$DIR arrowhead=$AH ]" >&3
  23. echo "}" >&3
  24. exec 3>&-
  25. dot -T$FMT $F > $TGT
  26. rm -f $F