
make sh-script compatible between SUN-sh and bash
Hello everyone,
we are plotting posters of our scientific research using GLE
which has a minor bug in the postscript output, i'm trying
to fix this, with a little shell-script.
i'd like that to run with solaris and linux since we are
working within a SUN-NIS-cluster with some linux-pc's
the problem is in the second line if...
in SUN-OS i have to escape the \&\& to make it work,
despite of using bash which only works with &&
Is there any possibility to fix this?
thanx & solong, gtr
#!/bin/sh
if [ -f $1 ] \&\& [ $1 ] && [ $2 ]; then
awk '
{print}
$1=="%%BoundingBox:" {x=$4+2; y=$5+2}
{if (($1=="%%EndComments")&&(NR<20)) {print"2 dict dup /PageSize ["x"
"y"] put\
{if (($1=="/umatrix")&&(NR<20)) {print "2 2 translate"}}
' $1 > $2
exit 0
else
echo $0": This Script is for fixing the GLE-Poster-Scaling bug"
echo $0": usage: "$0" gle_eps_inputfile.eps gle_eps_putputfile.eps"
exit 1
fi