Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!mhuxt!mhuxr!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.unix Subject: Re: redirecting stdin in ksh Message-ID: <1750@brl-tgr.ARPA> Date: Sun, 19-Jan-86 18:54:00 EST Article-I.D.: brl-tgr.1750 Posted: Sun Jan 19 18:54:00 1986 Date-Received: Thu, 23-Jan-86 20:37:42 EST References: <235@mtuni.UUCP> Distribution: net Organization: Ballistic Research Lab Lines: 15 > exec 3<&0 < file # dup stdin to fd 3, and redirect from file > while [ "$more" ] > do > read number age name > if [ "$?" -eq 0 ] > then > process number, age, name > else # end of file > more="" > fi > done > exec 0<&3 3<&- # redirect stdin back to fd 0, close fd 3 My guess is that ksh closed down all fds other than 0,1,2 when execing a command inside the loop.