Try the attached script.
#!/bin/sh
# script for book generation.
# Examples of use: man -t <command> | book | lpr -P<printer>
#      This will print the man pages in book format and
#      both sides. If you need file out, say:
#    man -t <command> |book > out.ps
#
# You can use: cat name.ps | book > name2.ps

PATH=/usr/local/bin:/usr/bin:/bin
export PATH

PSBOOK=/usr/local/bin/psbook
PSNUP=/usr/local/bin/psnup
PSTOPS=/usr/local/bin/pstops

if test $# -gt 0; then
   for N in $*; do
      $PSBOOK -q $N | $PSNUP -q -2 | $PSTOPS -q "2:0,1U(1w,1h)"
   done
else
   $PSBOOK -q | $PSNUP -q -2 | $PSTOPS -q "2:0,1U(1w,1h)"
fi

Reply via email to