From owner-freebsd-doc@FreeBSD.ORG Mon Apr 19 11:20:13 2004 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4262916A4CE for ; Mon, 19 Apr 2004 11:20:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D5CB43D49 for ; Mon, 19 Apr 2004 11:20:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i3JIKDbv049927 for ; Mon, 19 Apr 2004 11:20:13 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i3JIKCis049926; Mon, 19 Apr 2004 11:20:12 -0700 (PDT) (envelope-from gnats) Date: Mon, 19 Apr 2004 11:20:12 -0700 (PDT) Message-Id: <200404191820.i3JIKCis049926@freefall.freebsd.org> To: freebsd-doc@FreeBSD.org From: Simon Barner Subject: Re: docs/65766: [printing] Fdescfs needs to be mounted on FreeBSD 5.x X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Simon Barner List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 18:20:13 -0000 The following reply was made to PR docs/65766; it has been noted by GNATS. From: Simon Barner To: Marc Fonvieille Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: docs/65766: [printing] Fdescfs needs to be mounted on FreeBSD 5.x Date: Mon, 19 Apr 2004 20:07:38 +0200 --xB0nW4MQa6jZONgY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > #!/bin/sh >=20 > printf "\033&k2G" || exit 2 >=20 > IFS=3D"" read -r first_line > first_two_chars=3D`expr "$first_line" : '\(..\)'` >=20 > case "${first_two_chars}" in > \%\!*) > /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=3Ddjet500 \ > -sOutputFile=3D- - && exit 0 > ;; > *) > echo "$first_line" && cat && printf "\033&l0H" && exit 0 > ;; > esac >=20 > exit 2 I just had another look at the original script: # # It is PostScript; use Ghostscript to scan-convert and print it. # # Note that PostScript files are actually interpreted programs, # and those programs are allowed to write to stdout, which will # mess up the printed output. So, we redirect stdout to stderr # and then make descriptor 3 go to stdout, and have Ghostscript # write its output there. Exercise for the clever reader: # capture the stderr output from Ghostscript and mail it back to # the user originating the print job. # Your script does not pay attention to the fact that postscript program might mess up stdout, so I guess there is no way around the redirection to fd 3. Is there anything bad about having fdecsfs mounted? --xB0nW4MQa6jZONgY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAhBVqCkn+/eutqCoRAoM5AJ44aJrG3LC4ycFz8eCUKIhwVKzHOwCgtPzB 3ZThA3kgl2c90NaYJyBaD3k= =pQ3t -----END PGP SIGNATURE----- --xB0nW4MQa6jZONgY--