From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10233 invoked from network); 23 Feb 2021 13:39:46 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 23 Feb 2021 13:39:46 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 092EF9CA74; Tue, 23 Feb 2021 23:39:45 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 2384493D39; Tue, 23 Feb 2021 23:39:09 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 6857D93D39; Tue, 23 Feb 2021 23:39:07 +1000 (AEST) X-Greylist: delayed 901 seconds by postgrey-1.36 at minnie.tuhs.org; Tue, 23 Feb 2021 23:39:06 AEST Received: from server907.appriver.com (server907.appriver.com [204.232.250.38]) by minnie.tuhs.org (Postfix) with ESMTPS id 9D1FA93D32 for ; Tue, 23 Feb 2021 23:39:06 +1000 (AEST) X-Note: This Email was scanned by AppRiver SecureTide X-Note-AR-ScanTimeLocal: 02/23/2021 8:24:13 AM X-Note: SecureTide Build: 1/11/2021 3:44:12 PM UTC (2.17.10.0) X-Note: Filtered by 10.246.0.223 X-Note-AR-Scan: None - PIPE Received: by server907.appriver.com (CommuniGate Pro PIPE 6.2.15) with PIPE id 59620978; Tue, 23 Feb 2021 08:24:13 -0500 Received: from [10.246.0.39] (HELO smtp.us.exg7.exghost.com) by server907.appriver.com (CommuniGate Pro SMTP 6.2.15) with ESMTPS id 59620970; Tue, 23 Feb 2021 08:24:09 -0500 Received: from E16DN31A-S1E7.exg7.exghost.local (192.168.244.15) by E16DN31A-S1E7.exg7.exghost.local (192.168.244.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.0; Tue, 23 Feb 2021 08:23:59 -0500 Received: from E16DN31A-S1E7.exg7.exghost.local ([192.168.244.15]) by E16DN31A-S1E7.exg7.exghost.local ([192.168.244.15]) with mapi id 15.01.2176.000; Tue, 23 Feb 2021 08:23:59 -0500 From: Brantley Coile To: Jaap Akkerhuis Thread-Topic: [TUHS] Proliferation of options is great simplification of pipes, really? Thread-Index: AQHXCY5ZfNLXNE/zGkaRwF8glwismapl4eAAgAAtHQA= Date: Tue, 23 Feb 2021 13:23:59 +0000 Message-ID: <47E2CC0C-83C7-4C49-B80D-5510F50B7655@coraid.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [99.102.142.76] x-rerouted-by-exchange: MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: <88E419F9E51612469C097DEABABC565F@fwd7.exghost.com> Content-Transfer-Encoding: quoted-printable X-Note: This Email was scanned by AppRiver SecureTide X-Note-AR-ScanTimeLocal: 02/23/2021 8:24:09 AM X-Note: SecureTide Build: 1/11/2021 3:44:12 PM UTC (2.17.10.0) X-Note: Filtered by 10.246.0.223 X-Policy: GLOBAL X-Primary: GLOBAL@coraid.com X-Note-Sender: X-Virus-Scan: V- X-Note-SnifferID: 0 X-GBUdb-Analysis: 1, 192.168.244.15, Ugly c=0.687555 p=-0.994937 Source White X-Signature-Violations: 0-0-0-7288-c X-Note-419: 15.6337 ms. Fail:0 Chk:1411 of 1411 total X-Note: VSCH-CT/SI: 0-1411/SG:1 2/23/2021 8:23:12 AM X-Note: Spam Tests Failed: X-Country-Path: PRIVATE->PRIVATE-> X-Note-Sending-IP: 10.246.0.39 X-Note-Reverse-DNS: X-Note-Return-Path: brantley@coraid.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G826 G827 G828 G829 G847 G848 G849 G1256 X-Note: Encrypt Rule Hits: X-Note: Mail Class: VALID Subject: Re: [TUHS] Proliferation of options is great simplification of pipes, really? X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "tuhs@minnie.tuhs.org" Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" #!/bin/rc # doctype: synthesize proper command line for troff troff=3Dtroff eqn=3Deqn prefer=3Dprefer opt=3D'' dev=3D'' while(~ $1 -*){ switch($1){ case -n; troff=3Dnroff eqn=3Dneqn prefer=3D'prefer -n' case -T dev=3D$1 case -* opt=3D$opt' $1' } shift } ifs=3D' '{ files=3D`{echo $*} } grep -h '\$LIST|\|reference|Jp|^\.(EQ|TS|\[|PS|IS|GS|G1|GD|PP|BM|LP|BP|PI|c= start|begin|TH...|TI)|^\.P$' $* | sort -u | awk ' BEGIN { files =3D "'$"files'" } /\$LIST/ { e++ } /^\.PP/ { ms++ } /^\.LP/ { ms++ } /^\.EQ/ { eqn++ } /^\.TS/ { tbl++ } /^\.PS/ { pic++ } /^\.IS/ { ideal++ } /^\.GS/ { tped++ } /^\.G1/ { grap++; pic++ } /^\.GD/ { dag++; pic++ } /^\.\[/ { refer++ } /\|reference/ { prefer++ } /^\.cstart/ { chem++; pic++ } /^\.begin +dformat/ { dformat++; pic++ } /^\.TH.../ { man++ } /^\.BM/ { lbits++ } /^\.P$/ { mm++ } /^\.BP/ { pictures++ } /^\.PI/ { pictures++ } /^\.TI/ { mcs++ } /^\.ft *Jp|\\f\(Jp/ { nihongo++ } END { x =3D "" if (refer) { if (e) x =3D "refer/refer -e " files " | " else x =3D "refer/refer " files "| " files =3D "" } else if (prefer) { x =3D "cat " files "| '$prefer'| "; files =3D "" } if (tped) { x =3D x "tped " files " | "; files =3D "" } if (dag) { x =3D x "dag " files " | "; files =3D "" } if (ideal) { x =3D x "ideal -q " files " | "; files =3D "" } if (grap) { x =3D x "grap " files " | "; files =3D "" } if (chem) { x =3D x "chem " files " | "; files =3D "" } if (dformat) { x =3D x "dformat " files " | "; files =3D "" } if (pic) { x =3D x "pic " files " | "; files =3D "" } if (tbl) { x =3D x "tbl " files " | "; files =3D "" } if (eqn) { x =3D x "'$eqn' '$dev' " files " | "; files =3D "" } x =3D x "'$troff' " if (man) x =3D x "-man" else if (ms) x =3D x "-ms" else if (mm) x =3D x "-mm" if (mcs) x =3D x " -mcs" if (lbits) x =3D x " -mbits" if (pictures) x =3D x " -mpictures" if (nihongo) x =3D x " -mnihongo" x =3D x " '$opt' '$dev' " files print x }' > On Feb 23, 2021, at 5:42 AM, Jaap Akkerhuis wrote: >=20 >=20 >=20 >> On Feb 23, 2021, at 3:47, M Douglas McIlroy wrote: >>=20 >>> I can imagine a simple perl (or python or whatever) script that would r= un >>> through groff input [and] determine which preprocessors are actually >>> needed ... >>=20 >> Brian imagined such and implemented it way back when. Though I used >> it, I've forgotten its name. One probably could have fooled it by >> tricks like calling pic only in a .so file and perhaps renaming .so. >> But I never heard of it failing in real life. It does impose an extra >> pass over the input, but may well save a pass compared to the >> defensive groff -pet that I often use or to the rerun necessary when I >> forget to mention some or all of the filters. >=20 >=20 > If I remember correctly, it was an awk script printing out the > suggested pipeline to use. One could then cut and paste that line. >=20 > jaap