Xref: utzoo news.software.b:4872 unix-pc.general:5569 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!n8emr!uncle!celebr!jbm From: jbm@celebr.uucp (John B. Milton) Newsgroups: news.software.b,unix-pc.general Subject: Re: cnews on a 3B1 with ksh Message-ID: <1990May31.233757.27033@celebr.uucp> Date: 31 May 90 23:37:57 GMT References: <1990May22.212714.6570@bagend.uucp> <1990May23.190938.16011@shibaya.lonestar.org> Organization: Celebrezze Committee Lines: 37 In article <1990May23.190938.16011@shibaya.lonestar.org> afc@shibaya.UUCP (Augustine Cano) writes: >In article <1990May22.212714.6570@bagend.uucp> jan@bagend.uucp (Jan Isley) writes: ... >I encountered the problem too when installing cnews. The culprit is a >string in inews called `egreppat'. As it is, with 4 back-slashes, it works >with sh. To make it work with ksh, it has to have 2. If you make this >change, it will only work with ksh. One solution is to modify inews to >use the 4-back-slash egreppat when run by sh and the 2-back-slash one when >run by ksh. My first solution was to just replace the 4 slashes with 2. >This way, inews would work when I posted from the shell prompt using Pnews. >When posting a followup from within rn, however, inews was run through sh >and it broke the fix. My current solution, which works in both cases is >to leave egreppat with the 4 slashes and modify Pnews and replace the >line > if $inews -h < $tmpart ; then >with > if sh $inews -h < $tmpart ; then The problem is NOT with Pnews, it's inews. My solution was to patch inews, adding the + lines: +if [ "$RANDOM" = "$RANDOM" ]; then egreppat="^(` sed -e 's/[.+*()|[]/\\\\&/g' -e 's/,/|/g' <$nglist `) " +else + egreppat="^(` sed -e 's/[.+*()|[]/\\&/g' -e 's/,/|/g' <$nglist `) " +fi Everytime ksh evaluates the environment variable RANDOM, ksh changes it to a different random number, which /bin/sh does not do. I sent this fix off to the cnews folks. I have not tested the behavior of a ksh88, so this may not be a global solution. John -- John Bly Milton IV, jbm@uncle.UUCP, n8emr!uncle!jbm@osu-cis.cis.ohio-state.edu (614) h:252-8544, w:469-1990; N8KSN, AMPR: 44.70.0.52; Don't FLAME, inform!