From mboxrd@z Thu Jan 1 00:00:00 1970 From: presotto@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] Fax problem MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-odnyovilkpfnhqqciabmwjuleg" Message-Id: <20010602165814.EC2EB199E4@mail.cse.psu.edu> Date: Sat, 2 Jun 2001 12:58:13 -0400 Topicbox-Message-UUID: ae1a133e-eac9-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-odnyovilkpfnhqqciabmwjuleg Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I'm currently using: # convert to g3 g3files=() a=1 for(i in $infiles){ switch(`{file <$infiles(1)}){ case *:*g3* *:*fax* g3files=($g3files $i) case *:*postscript gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$tmp'.'$#a'.%03d' -dNOPAUSE -dQUIET $i quit.ps g3files=($g3files $tmp.$#a.*) case * lp -dstdout $i > $tmpps gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$tmp'.'$#a'.%03d' -dNOPAUSE -dQUIET $tmpps quit.ps g3files=($g3files $tmp.$#a.*) } a=($a $a) } --upas-odnyovilkpfnhqqciabmwjuleg Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Sat Jun 2 10:01:24 EDT 2001 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Sat Jun 2 10:01:22 EDT 2001 Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.30.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id D7EBA19A03; Sat, 2 Jun 2001 10:01:07 -0400 (EDT) Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 5B6B9199EF for <9fans@cse.psu.edu>; Sat, 2 Jun 2001 10:00:26 -0400 (EDT) Received: from hamnavoe.demon.co.uk ([158.152.225.204] helo=hamnavoe) by tele-post-20.mail.demon.net with smtp (Exim 2.12 #2) id 156Bx3-000L0O-0K for 9fans@cse.psu.edu; Sat, 2 Jun 2001 14:00:25 +0000 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: Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Sat, 2 Jun 2001 14:57:59 0100 If we're going to fix fax, we might as well also handle the general case of faxing multiple files of different type. How about replacing the switch(`{file $infiles(1)}) statement -- which only checks the type of the first file -- with something like this: # convert to g3 g3files=() ntmp=1 for (infile in $infiles) { otmp=$tmp.$ntmp ntmp=`{echo $ntmp+1 | hoc} switch(`{file <$infile}){ case *g3* *fax* g3files=($g3files $infile) case postscript gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$otmp.'.%03d' -dNOPAUSE -d QUIET $infile quit.ps g3files=($g3files $otmp.*) case * lp -dstdout $infile > $tmpps gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$otmp'.%03d' -dNOPAUSE -dQUIET $tmpps quit.ps g3files=($g3files $otmp.*) } } -- Richard --upas-odnyovilkpfnhqqciabmwjuleg--