home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / graphics-0.17 / plot2ps / atend.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1990-08-28  |  281 b   |  16 lines

  1. #!/bin/sh
  2. #!/bin/sh -xv
  3. f=/tmp/atend$$
  4. trap "rm -f $f;exit" 0 1 2 3 15
  5. cat >$f
  6. bb=`awk '/^%%BoundingBox: [0-9]/{print}' <$f`
  7. if [ -n "${bb}" ]; then
  8.     awk "\
  9. \$1~/%%BoundingBox:/{if(\$2~/atend/) print \"${bb}\";}\
  10. \$1!~/%%BoundingBox:/{print;}\
  11. " <$f
  12. else
  13.     cat $f
  14. fi
  15. /bin/rm -rf $f
  16.