Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2011 10:57:31 -0700
From:      Chip Camden <sterling@camdensoftware.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Fast personal printing _without_ CUPS
Message-ID:  <20111027175731.GD1058@libertas.local.camdensoftware.com>
In-Reply-To: <15996.1319704110@tristatelogic.com>
References:  <15996.1319704110@tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111027175731.GD1058>