docs/65766: [printing] Fdescfs needs to be mounted on FreeBSD 5.x

Simon Barner barner at
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>
To: Marc Fonvieille <blackend at>
Cc: FreeBSD-gnats-submit at
Subject: Re: docs/65766: [printing] Fdescfs needs to be mounted on FreeBSD 5.x
Date: Mon, 19 Apr 2004 20:07:38 +0200

 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 > #!/bin/sh
 > printf "\033&k2G" || exit 2
 > IFS=3D"" read -r first_line
 > first_two_chars=3D`expr "$first_line" : '\(..\)'`
 > 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
 > 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?
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: Digital signature
 Content-Disposition: inline
 Version: GnuPG v1.2.4 (FreeBSD)

More information about the freebsd-doc mailing list