Xref: utzoo news.software.b:4835 unix-pc.general:5524 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!texbell!vector!egsner!shibaya!afc From: afc@shibaya.lonestar.org (Augustine Cano) Newsgroups: news.software.b,unix-pc.general Subject: Re: cnews on a 3B1 with ksh Message-ID: <1990May23.190938.16011@shibaya.lonestar.org> Date: 23 May 90 19:09:38 GMT References: <1990May22.212714.6570@bagend.uucp> Reply-To: afc@shibaya.UUCP (Augustine Cano) Organization: Multidisciplinary Designs Unlimited Lines: 62 In article <1990May22.212714.6570@bagend.uucp> jan@bagend.uucp (Jan Isley) writes: >If I may quote from cnews "problems" doc without getting cancelled by >merlyn@iwarp.intel.com.the.screeming.idiot.copywrite.censor :-( > > Many people using 3B1s, aka UNIX PCs, run the Korn shell as > their bin/sh. Some other folks may do this too. Beware that > ksh was not fully sh-compatible for a long time, with some > subtle differences in the ill-documented behavior of backquotes > and backslashes. Some of the C News shell scripts, notably > inews, are known to hit these bugs. We are told that current > kshs have fixed them. > >Yes, I use ksh. Pnews and postnews fail to find any newsgroup in >the active file that has a '.' in it. I can post to 'general' just >fine. Posting to 'to.bagend' for instance, (or any other equally valid >mutli word group at my site, like news.software.b) produces: 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 BTW, I'm still using rn PL40. > /usr/bin/inews: to.bagend matches no groups in /usr/lib/news/active > >If I 'exec sh' before posting, articles go through just fine, of course. > >Now, for the stupid questions part: > >Given that all of the cnews files begin with '#! /bin/sh', why >do the processes blindly run off and do their /bin/ksh thing? If you >are going to tell me to RTFM about why #! /bin/sh does not work on the >3B1, please include the page number you found it on, okay? I missed it. Some programs that use Larry Wall's Configure script test for this and tell you that "#! /bin/sh" doesn't work. Apparently, what works is ": use /bin/sh". I suppose one solution would be to replace all "#!..." with ": use ..." >Setting SHELL=/bin/sh, exporting SHELL or not, making inews or Pnews >or postnews suid or guid etc, etc, etc... has the same effect. If the >user is using ksh, everything else uses ksh. > >Now, if I could just find that nomex suit I had .... >-- >Signatures!? | Jan Isley jan@bagend >We don't need no stinking signatures. | known_universe!gatech!bagend!jan I hope this helps... Augustine Cano afc@shibaya.lonestar.org