#! /bin/bash # qbb_bounding_box qui=$1 shift case $qui in -h) echo "" echo " syntax :" ; echo " -y suivi de (g t d b) : absolues" ; echo " +g -g etc : relatives" ; echo " -x : commit" ; echo "" ; exit;; esac echo " proceeding" $qui zozo=`grep Bounding $qui.eps` zozu=`echo $zozo` z1=`echo "$zozo " | sed -e 's/\ .*//'` zozo=`echo "$zozo" | sed -e 's/[^\ ]*\ //'` # echo $zg $zb $zd $zt "reste" $zozo zg=`echo "$zozo" | sed -e 's/\ .*//'` zozo=`echo "$zozo" | sed -e 's/[^\ ]*\ //'` # echo $zg $zb $zd $zt "reste" $zozo zb=`echo "$zozo" | sed -e 's/\ .*//'` zozo=`echo "$zozo" | sed -e 's/[^\ ]*\ //'` # ho $zg $zb $zd $zt "reste" $zozo zd=`echo "$zozo" | sed -e 's/\ .*//'` zozo=`echo "$zozo" | sed -e 's/[^\ ]*\ //'` # echo $zg $zb $zd $zt "reste" $zozo # caveat : ctrl-j ctrl-m from the win world !!! zozo=`echo "$zozo" | sed -e 's/[0-9]*/&\ xxx/'` zt=`echo "$zozo" | sed -e 's/\ .*//'` # echo $zg $zb $zd $zt "reste" $zozo while test -n "$1" ; do case $1 in -y) zg=$2 ; zt=$3 ; zd=$4 ; zb=$5 ; shift ; shift ; shift ;; +g) zg=`echo $((zg-$2))` ;; -g) zg=`echo $((zg+$2))` ;; +b) zb=`echo $((zb-$2))` ;; -b) zb=`echo $((zb+$2))` ;; +d) zd=`echo $((zd+$2))` ;; -d) zd=`echo $((zd-$2))` ;; +t) zt=`echo $((zt+$2))` ;; -t) zt=`echo $((zt-$2))` ;; -x) xxx=commit ;; *) echo erreur ;; esac shift shift done zozo=`echo "%%BoundingBox:" $zg $zb $zd $zt` echo was $zozu echo now $zozo sed -e "`echo s/$zozu/$zozo/ `" $qui.eps > tmp.eps if test -n "$xxx" then cp tmp.eps $qui.eps else gv tmp.eps fi