docs/65766: [printing] Fdescfs needs to be mounted on FreeBSD 5.x
Simon Barner
barner at in.tum.de
Mon Apr 19 18:20:13 UTC 2004
The following reply was made to PR docs/65766; it has been noted by GNATS.
From: Simon Barner <barner at in.tum.de>
To: Marc Fonvieille <blackend at FreeBSD.org>
Cc: FreeBSD-gnats-submit at 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--
More information about the freebsd-doc
mailing list