From owner-FreeBSD-users-jp@jp.freebsd.org  Tue Feb 24 13:00:01 1998
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) id NAA15126
	Tue, 24 Feb 1998 13:00:01 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) with SMTP id MAA15118
	for <FreeBSD-users-jp@jp.freebsd.org>; Tue, 24 Feb 1998 12:59:58 +0900 (JST)
Received: by nazuna.bres.tsukuba.ac.jp (SMI-8.6/SMI-SVR4)
	id MAA06598; Tue, 24 Feb 1998 12:59:56 +0900
Date: Tue, 24 Feb 1998 12:59:56 +0900
Message-Id: <199802240359.MAA06598@nazuna.bres.tsukuba.ac.jp>
To: FreeBSD-users-jp@jp.freebsd.org
Cc: cond@osk2.3web.ne.jp
In-Reply-To: Your message of "Tue, 24 Feb 1998 00:54:13 JST".
	<199802231554.AAA20760@pop2.osk.3web.ne.jp>
From: yohta@bres.tsukuba.ac.jp (Yoshihiko OHTA)
X-Mailer: mnews [version 1.21PL1] 1998-02/16(Mon)
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=24]
X-Sequence: FreeBSD-users-jp 24989
Subject: [FreeBSD-users-jp 24989] Re: [Q]postscript$B%U%!%$%k$r(B gs $B$G(B MJ-800C$B$K=PNO$G$-$^$;$s!#(B
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org

$B!!B@ED!wC^GHBg$G$9!#(B

1998-02-24($B2P(B) 00:54:13.$B:"!"(Bcond@osk2.3web.ne.jp$B$5$s$O=q$-$^$7$?!#(B

>%cat /usr/local/libexec/gsif
>#!/bin/sh 
($BN,(B)
>printf "\033&k2G" || exit 2
($BN,(B)
>if [ "$first_two_chars" = "%!" ]; then
>#
># It is PostScript; use Ghostscript to scan-convert and print it
>#
>/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=mjc360 -sOutputFile=- - \
>	&& exit 0
>else
>    echo $first_line && cat && printf "\f" && exit 2
>fi

  $first_two_chars $B$d(B $first_line $B$O$I$3$GDj5A$5$l$F$$$k$N$G$9$+!)(B


>#
>#  Read first two characters of the file
>#
>read first_line
>first_two_chars=`expr "$first_line" : '\(..\)'`

$B$H$$$&ItJ,$,;29MJ88%$K$O:\$C$F$$$^$;$s$G$7$?$+!)(B  $B$X$?$K>JN,$9$k(B
$B$H$h$m$7$/$J$$$H;W$$$^$9!#(Bcond$B!w(B3Web $B$5$s$N(B gsif $B$G$9$H!"(B
$first_two_chars $B$O>o$KL$Dj5A$J$N$G!"7h$7$F(B gs $B$,5/F0$5$l$k$3$H(B
$B$O$J$/$J$C$F$7$^$&$H;W$$$^$9!#(B


  $B;29M$N$?$a$K;d$N(B script $B$r:\$;$F$*$-$^$9!#(BLIPS III $BMQ$G(B qkc $B$,(B
$BI,MW$G$9$,!#(B
#!/bin/sh
#
#  iflips3 - Print Ghostscript-simulated PostScript on a LASER SHOT A404F
#  Installed in /usr/local/libexec/iflips3

#
#  Read first two characters of the file
#
read first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
    #
    #  It is PostScript; use Ghostscript to scan-convert and print it
    #
    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=lips3 -sOutputFile=- - \
        && exit 0

else
    #
    #  Plain text or HP/PCL, so just print it directly; print a form
    #  at the end to eject the last page.
    #
    ((echo $first_line && cat) | /usr/local/bin/qkc -m -j) && printf "\f" \
	&& exit 2
fi

exit 2
--
$BB@EDK'I'(B(Yoshihiko Ohta)  $BC^GHBg3X!!%P%$%*%7%9%F%`8&5f2J(B
E-mail: yohta@bres.tsukuba.ac.jp
