#!/bin/sh bbox=`gs -sDEVICE=bbox -dBATCH -dNOPAUSE $@ 2>&1 >/dev/null | grep '%%BoundingBox' | sed '/downloads/s/n/index.html'` sed -i "s@^%%BoundingBox.*@${bbox}@" $@