Fast personal printing _without_ CUPS

Chip Camden sterling at camdensoftware.com
Thu Oct 27 17:57:36 UTC 2011


Quoth Ronald F. Guilmette on Thursday, 27 October 2011:
> ============================================================================
> #!/bin/sh
> 
> printer='/dev/ulpt0'
> 
> if [ $# = 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='/dev/ulpt0'

if [ $# = 0 ]; then
  /usr/local/libexec/psif > $printer
else
  for arg in $* ; do
    /usr/local/libexec/psif < $arg > $printer
  done
fi

Nice work, though!

-- 
.O. | Sterling (Chip) Camden      | http://camdensoftware.com
..O | sterling at camdensoftware.com | http://chipsquips.com
OOO | 2048R/D6DBAF91              | http://chipstips.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20111027/1f6acc2f/attachment.pgp


More information about the freebsd-questions mailing list