Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards Subject: Re: The bourne shell again ( summary and question ) Message-ID: <5405@utzoo.UUCP> Date: Tue, 2-Apr-85 17:58:23 EST Article-I.D.: utzoo.5405 Posted: Tue Apr 2 17:58:23 1985 Date-Received: Tue, 2-Apr-85 17:58:23 EST References: <75@cithep.UucP> Organization: U of Toronto Zoology Lines: 18 > number=one > while something > do > number=two > done < TheLarch > > 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. The quick answer is, it should. If you interpose a shell function (only found in more recent Bourne shells) between the loop and the redirection, it does it right. When redirection of builtin commands was added to the shell -- post-V7 -- all the machinery that would be needed was added. It just hasn't been applied to this case yet. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry