From owner-freebsd-questions Wed Feb 12 15:28:58 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6519037B405 for ; Wed, 12 Feb 2003 15:28:57 -0800 (PST) Received: from mx1.eskimo.com (mx1.eskimo.com [204.122.16.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4229143FAF for ; Wed, 12 Feb 2003 15:28:53 -0800 (PST) (envelope-from ripper@eskimo.com) Received: from eskimo.com (ripper@eskimo.com [204.122.16.13]) by mx1.eskimo.com (8.9.1a/8.8.8) with ESMTP id PAA13846 for ; Wed, 12 Feb 2003 15:28:46 -0800 Received: (from ripper@localhost) by eskimo.com (8.9.1a/8.9.1) id PAA26621 for freebsd-questions@freebsd.org; Wed, 12 Feb 2003 15:28:47 -0800 (PST) Date: Wed, 12 Feb 2003 15:28:46 -0800 From: Ross Lippert To: freebsd-questions@freebsd.org Subject: devfs and /dev/fd/3 Message-ID: <20030212152846.A21838@eskimo.eskimo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i WWW-Home-Page: http://www.eskimo.com/~ripper Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I just installed freebsd 5.0. One gotcha that got me was in my lpif filter, which used to use a clever set of redirects to send only the outputfile output of gs to stdout while the stdout output of gs was sent to stderr: exec 3>&1 1>&2 /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=cdj550 \ -sOutputFile=/dev/fd/3 - && exit 0 However, with the new devfs, I seem to be short a file descriptor, namely, fd/3. So I must do /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=cdj550 \ -sOutputFile=- - && exit 0 Which will work as long as gs doesn't decide to write something to stdout, at which point something bad will come out of my printer. Is there a better way to accomplish the above? -r To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message