From owner-freebsd-questions Sun Aug 20 22:36:28 2000 Delivered-To: freebsd-questions@freebsd.org Received: from watson.ficsgrp.com (watson.ficsgrp.com [194.74.111.3]) by hub.freebsd.org (Postfix) with ESMTP id CC8B137B424 for ; Sun, 20 Aug 2000 22:36:25 -0700 (PDT) Received: from mail.au.ficsgrp.com ([194.74.111.35]) by watson.ficsgrp.com (Netscape Messaging Server 3.6) with ESMTP id AAA1A7A for ; Mon, 21 Aug 2000 07:36:22 +0200 Received: from S1.com ([172.16.48.219]) by mail.au.ficsgrp.com (Netscape Messaging Server 3.6) with ESMTP id 119 for ; Mon, 21 Aug 2000 15:39:19 +1000 Message-ID: <39A0C03A.31B82F7@S1.com> Date: Mon, 21 Aug 2000 15:38:02 +1000 From: Harry Woodward-Clarke X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: FreeBSD Questions Subject: printing C source files Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hullo, I struck an interesting "problem" the other day printing a 'C' source file, where the first two characters start a comment, viz. "/*". I have, in my /etc/printcap the following... lp:\ :rm=172.16.48.9:\ :rp=:\ :if=/usr/local/libexec/lpfilter:\ :sd=/var/spool/output:\ :lf=/var/log/lpd-errs:\ :mx#0:\ :sh: which is pretty much out of the Complete FreeBSD and the Handbook. The 'lpfilter' file is: #!/bin/sh # PostScript & ASCII text filter # read first_line first_two_chars=`expr "$first_line" : '\(..\)'` if [ "$first_two_chars" = "%!" ]; then # # PostScript # echo "$first_line" && cat && printf "\004" && exit 0 exit 2 else # # ASCII text # printf "\033&k2G" && echo $first_line && \ cat && printf "\033&10H" && exit 0 fi exit 2 [end of file] Now, (some of you are already ahead of me), when I print my source code, the first line consists of ... "/COPYRIGHT /bin /boot /cdrom /compat /dev /dist /etc " i.e. a listing of the contents of "/", or rather "/*". Other than starting my C-code with a space or two, are there any suggestions? ;') It's not a real 'biggie', just piqued my curiosity ;') Thanks, haxxa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message