Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.unix.shell Subject: Re: Understanding the Bourne Shell (was Re: Finding the last arg) Message-ID: <1991Jan12.222507.27264@NCoast.ORG> Date: 12 Jan 91 22:25:07 GMT References: <1033@mwtech.UUCP> <1991Jan11.035416.18772@NCoast.ORG> <1991Jan12.012225.6727@robobar.co.uk> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.unix.shell Organization: North Coast Computer Resources (ncoast) Lines: 31 As quoted from <1991Jan12.012225.6727@robobar.co.uk> by ronald@robobar.co.uk (Ronald S H Khoo): +--------------- | allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) writes: | > There is one other problem. I daresay it would be possible to make Bourne | > shell syntax a bit more "regular" by using a yacc grammar. THIS WON'T WORK! | > At least, not without making the shell much less useful | | Well, the some of the chaps at research seem to be quite happy with "rc" | and that's got a yacc grammar... Apparently it was too painful to | port /bin/sh to Plan 9 so Duff wrote "rc". (He presented a paper on it | to the UKUUG Summer Conference last year) +--------------- I wondered if anyone would comment about that after I read the "rc" stuff. However, "rc" follows the general Plan 9 form (which, many ages, ago, was the general Unix form) of moving stuff into separate programs. "rc" is, in many ways, nowhere near as complex as even the V7 shell, much less the System V shell; it can get away with simple means of handling interactiveness in complex control structures. I was able to handle interactive use simply in a certain yacc grammar up to a certain point, then I had to start using context flags all over the place to make interactive use behave in an intuitive way. I don't recall what point it was, except that the program I was working on was gradually turning into a shell, which is why I eventually scrapped it in favor of using the existing shell. ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY