From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Fax problem From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: Date: Fri, 1 Jun 2001 14:09:27 +0100 Topicbox-Message-UUID: ac473244-eac9-11e9-9e20-41e7f4b1d025 There's a cute bug in /bin/fax, where it checks the input file type to see if postscript or text files need converting to g3 fax format: # convert to g3 switch(`{file $infiles(1)}){ case *g3* *fax* g3files=$infiles case postscript gs -dSAFER '-sDEVICE=dfaxlow' ... g3files=($tmp.*) case * lp -dstdout $infiles > $tmpps gs -dSAFER '-sDEVICE=dfaxlow' ... g3files=($tmp.*) } Because file(1) echoes the filename, the first case will be selected erroneously for a text or postscript file whose name contains 'fax' - and in particular when faxing from standard input, because stdin gets copied to a temp file called /tmp/fax.in.$pid . Simple correction: change the switch command to switch(`{file <$infiles(1)}){ -- Richard Miller