Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cithep.UucP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!trwrb!trwrba!escher!cithep!tim From: tim@cithep.UucP (Tim Smith ) Newsgroups: net.unix-wizards Subject: The bourne shell again ( summary and question ) Message-ID: <75@cithep.UucP> Date: Sun, 31-Mar-85 06:09:03 EST Article-I.D.: cithep.75 Posted: Sun Mar 31 06:09:03 1985 Date-Received: Tue, 2-Apr-85 06:22:06 EST Organization: Caltech HEP, Pasadena, CA Lines: 38 Ok, I see why if true x y z fi runs all but the last command in a subshell. I should have realized that. But I have still not received an explanation for the first problem I had. That concerned this construct: number=one while something do number=two done < TheLarch I wondered why the assignment in the loop was not done. Several people correctly pointed out that the body of the loop is done in a subshell, so the assignment does not show up outside the loop. Ok, fine. And now the question. Why is the body of the loop done in a subshell? Could it not use dup() to save the current stdin, and put it back after the loop? This is crtainly what I expected. If you feel like answering this, and are one of the following people, please post to the net to settle this once and for all: Goug Gwyn, Guy Harris, Henry Spencer, Chris Torek, Norman Wilson Otherwise, mail rather than post! -- Duty Now for the Future Tim Smith ihnp4!{wlbr!callan,cithep}!tim