#!/bin/sh
usage="Usage: lpr1 [-h] [file1.ps [-o file1_ru.ps]]...\n -h -- this help\n (no
arg) -- print ps-stdin in russian fonts\n file.ps -- print ps-file in russian fo
nts\n file.ps -o file_ru.ps -- convert fonts in russian ones"
prev=
is_file=0
header="/etc/netscapr.pro"
if test $# -eq 0
then cat > /tmp/lpr1$$
cat $header /tmp/lpr1$$ | lpr
rm -f /tmp/lpr1$$
exit
else while test $# -gt 0
do case $1 in
-h) echo -e "Copyright (C) 2000 xxxxxxx\n"
echo -e $usage
exit ;;
-o) if test -z $prev
then echo -e $usage
exit
fi
if test $# -eq 1
then echo -e $usage
exit
fi
shift
cat $header $prev > $1
shift
is_file=0 ;;
-?) echo "$0: no option $1"
echo -e $usage
exit ;;
*) if test $is_file -eq 1
then cat $header $prev | lpr
fi
if test -s $1
then prev=$1
is_file=1
else echo -e $usage
exit
fi
shift ;;
esac
done
if test $is_file -eq 1
then cat $header $prev | lpr
fi
fi
exit