Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!lll-winken!uunet!comp.vuw.ac.nz!mark From: mark@comp.vuw.ac.nz (Mark Davies) Newsgroups: news.software.b Subject: Re: newshist problem? Message-ID: <1991Jun02.012157.18432@comp.vuw.ac.nz> Date: 2 Jun 91 01:21:57 GMT References: <1991May30.194402.24916@ucselx.sdsu.edu> <1991May31.000943.10583@comp.vuw.ac.nz> <1991Jun1.193655.544@iWarp.intel.com> Sender: news@comp.vuw.ac.nz (News Admin) Distribution: usa Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Lines: 54 Nntp-Posting-Host: the-taj.comp.vuw.ac.nz Originator: mark@the-taj.comp.vuw.ac.nz In article <1991Jun1.193655.544@iWarp.intel.com>, merlyn@iWarp.intel.com (Randal L. Schwartz) writes: |> Gack. Starting a sh that did a bunch of echoes seemed a little |> wasted, so I did it in Perl. (The whole thing shows a zillion |> syscalls with trace, so there's bound to be a few more |> optimizations.) Thanks Randal. That was the obvious next step. My only excuse is that my copy of the Perl book was on loan at that time. Here is a small patch to your code to handle Message-IDs that contain "`" and other sh meta chars. With your current version you get "sh: syntax error at line 2: `newline or ;' unexpected" and similar messages popping out on standard error. cheers mark ps. Aren't ambiguious date formats fun (see below entries in the revision history). *** 4696 Sun Jun 2 12:17:41 1991 --- nstats Sun Jun 2 12:55:32 1991 *************** *** 71,76 **** --- 71,79 ---- # that it is a shell script # 06/01/91 merlyn@iWarp.intel.com # replaced mark's shell script with Perl code + # 02/06/91 mark@comp.vuw.ac.nz + # fix randal's code to handle Message-IDs + # of the form <`=C*~5+@cck.cov.ac.uk> # ############################################################ *************** *** 84,90 **** grep(!//, @ids); local($ids) = join("\n",@ids); open(newshist, "-|") || exec <<"PERL_EOF"; ! /usr/lib/newsbin/dbz -ix /usr/lib/news/history </, @ids); local($ids) = join("\n",@ids); open(newshist, "-|") || exec <<"PERL_EOF"; ! /usr/lib/newsbin/dbz -ix /usr/lib/news/history <<'SH_EOF' $ids SH_EOF PERL_EOF