home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PSCRIPT / GS241PS.ZIP / BBGET < prev    next >
Encoding:
Text File  |  1992-04-23  |  581 b   |  21 lines

  1. #!/bin/sh
  2. comment=`gsnd bbprint.ps bb4gs.ps $1 quit.ps </dev/null | grep %%`
  3. if [ -n "$comment" ]; then
  4.      echo computed bounding box: $comment 1>&2
  5. else
  6.      echo could not find bounding box. 1>&2
  7.      exit 1
  8. fi
  9. if grep -s %%BoundingBox $1 ; then
  10.      echo replacing bounding box. 1>&2
  11.      # replace the bounding box and write it out to stdout
  12.      sed -e "/%%BoundingBox/s/.*/$comment/" <$1
  13. else
  14.      echo inserting bounding box. 1>&2
  15.      # insert the bounding box on the second line and write it out to stdout
  16.      sed -e '2i\
  17. '"$comment"'
  18. ' <$1
  19. fi
  20. exit
  21.