From owner-freebsd-questions@FreeBSD.ORG Thu Oct 27 17:57:36 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B69D1106564A for ; Thu, 27 Oct 2011 17:57:36 +0000 (UTC) (envelope-from sterling@camdensoftware.com) Received: from wh1.interactivevillages.com (ca.2e.7bae.static.theplanet.com [174.123.46.202]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF518FC1B for ; Thu, 27 Oct 2011 17:57:36 +0000 (UTC) Received: from 184-78-197-203.war.clearwire-wmx.net ([184.78.197.203] helo=_HOSTNAME_) by wh1.interactivevillages.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1RJUCr-0003Gq-Fu for freebsd-questions@freebsd.org; Thu, 27 Oct 2011 10:57:10 -0700 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Thu, 27 Oct 2011 10:57:31 -0700 Date: Thu, 27 Oct 2011 10:57:31 -0700 From: Chip Camden To: freebsd-questions@freebsd.org Message-ID: <20111027175731.GD1058@libertas.local.camdensoftware.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <15996.1319704110@tristatelogic.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2Z2K0IlrPCVsbNpk" Content-Disposition: inline In-Reply-To: <15996.1319704110@tristatelogic.com> User-Agent: Mutt/1.4.2.3i Company: Camden Software Consulting URL: http://camdensoftware.com X-PGP-Key: http://pgp.mit.edu:11371/pks/lookup?search=0xD6DBAF91 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wh1.interactivevillages.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - camdensoftware.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: Fast personal printing _without_ CUPS X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 17:57:36 -0000 --2Z2K0IlrPCVsbNpk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoth Ronald F. Guilmette on Thursday, 27 October 2011: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > #!/bin/sh >=20 > printer=3D'/dev/ulpt0' >=20 > if [ $# =3D 0 ]; then > cat | /usr/local/libexec/psif > $printer > else > for arg in $* ; do > cat $arg | /usr/local/libexec/psif > $printer > done > fi Not to be a pedant (okay, maybe I am), but you could eliminate the extraneous `cat` in both commands: #!/bin/sh printer=3D'/dev/ulpt0' if [ $# =3D 0 ]; then /usr/local/libexec/psif > $printer else for arg in $* ; do /usr/local/libexec/psif < $arg > $printer done fi Nice work, though! --=20 =2EO. | Sterling (Chip) Camden | http://camdensoftware.com =2E.O | sterling@camdensoftware.com | http://chipsquips.com OOO | 2048R/D6DBAF91 | http://chipstips.com --2Z2K0IlrPCVsbNpk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQEcBAEBAgAGBQJOqZuLAAoJEIpckszW26+RQQsH/RlHBKfxvDzKL1Nc2MUFppzz uKc1NVfEbQjeKanGpmJ5yyILpD8ATtM1Jfv62/tt9Wk1AndjDCxKmh/Ik2jXr2IV pWBKVckZStun0QoLgmK3XOuUFU/lRylBLWaaZ8MdC00sZJtQWYHICpvEAYJktEVC nTwIdBbPCT9oGGj0E3gn2oAWWcDLinAhf3b/ZTiGZXCSLqnpFfrxewIkoLAL8UA4 A8HvsROTGZfE9HNIiYAvh8WsipvJuUC2TpSbIvqORV3c4EbJUKVvHwdeamt7W5bW ws5w0FDjRAfCMIXdcP2Vg3JWwrjITc94bh0rnvrY0aKBOxHnCEjV1fTOWQDokZ0= =aLxp -----END PGP SIGNATURE----- --2Z2K0IlrPCVsbNpk--