mkshapes.sh 646 B

1234567891011121314151617181920212223242526272829303132
  1. #! /bin/ksh
  2. # For each name in shapelist, create a dot file using that
  3. # shape, then produce a gif file as output.
  4. for s in $(cat shapelist)
  5. do
  6. F=$s.dot
  7. exec 3> $F
  8. echo "digraph G {" >&3
  9. if [[ $s == "plaintext" || $s == "none" || $s == "underline" || $s == "plain" ]]
  10. then
  11. echo " node [shape=$s];" >&3
  12. else
  13. echo " node [style=filled,shape=$s];" >&3
  14. echo " node [label=\"\"];" >&3
  15. fi
  16. if [[ $s == point ]]
  17. then
  18. echo " node [width=\"0.1\"];" >&3
  19. elif [[ $s == polygon ]]
  20. then
  21. echo " node [sides=7]; " >&3
  22. fi
  23. echo " $s;" >&3
  24. echo "}" >&3
  25. exec 3>&-
  26. dot -Tgif $s.dot > $s.gif
  27. rm -f $s.dot
  28. done