Newsgroups: comp.unix.shell Path: utzoo!utgpu!watserv1!maytag!maytag!himacdon From: himacdon@maytag.uwaterloo.ca (Hamish Macdonald) Subject: Re: A new shell. Any takers? In-Reply-To: andy@xwkg.Icom.Com's message of 15 Jan 91 18:23:06 GMT Message-ID: <1991Jan15.213533.9992@maytag.waterloo.edu> Sender: daemon@maytag.waterloo.edu (Admin) Organization: University of Waterloo, Waterloo, Ontario References: <11134@helios.TAMU.EDU> <2573@root44.co.uk> Date: Tue, 15 Jan 91 21:35:33 GMT Lines: 34 >>>>> In article , andy@xwkg.Icom.Com (Andrew H. >>>>> Marrinson) writes: Andrew> I almost sent email asking this same question. Then I Andrew> realized why. (At least, I think I realized.) The if not Andrew> command is not exactly the same as an else. True, in the Andrew> above example it seems it could be replaced with else to good Andrew> effect, but consider: Andrew> if (command) { Andrew> if (command) Andrew> command Andrew> } Andrew> if not Andrew> command Andrew> I suspect the if not applies to the second if, not the first. Andrew> Naming it else would cause people to expect it to apply to the Andrew> first if, as an else would. Calling it if not makes it clear Andrew> it is different from else: it applies to the last if command Andrew> run, and knows nothing about the lexical structure of the Andrew> script. Nope. The "if not" applies to the first if (by experimentation). "rc" must stack the results of the "if"s. I suspect it uses "if not" because the: if not command is a separate statement. Hamish. -- -------------------------------------------------------------------- himacdon@maytag.uwaterloo.ca watmath!maytag!himacdon