From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from SINet.SLB.COM ([163.185.18.1]) by hawkwind.utcs.toronto.edu with SMTP id <2689>; Thu, 23 Sep 1993 03:32:03 -0400 Received: from snmrtr.psi by SINet.SLB.COM id AA19392; Thu, 23 Sep 93 07:34:43 GMT From: gjv%atlas%cesar@crbca1.SINet.SLB.COM Message-Id: <9309230734.AA19392@SINet.SLB.COM> Apparently-To: "hawkwind.utcs.toronto.edu::rc" X-Vms-From: PSI%CRBCA1::CESAR::ATLAS::"gjv" X-Vms-To: HERMES::M_MAILNOW::M_INTERNET::HAWKWIND.UTCS.TORONTO.EDU::RC Received: by DniMail (v1.0); Thu Sep 23 09:30:17 1993 MET DST Received: from pyxis by atlas.atlasnis (4.1/SMI-4.1-DNI) id AA11959; Thu, 23 Sep 93 09:30:00 +0200 To: rc%hawkwind.utcs.toronto.edu%m_internet%m_mailnow%hermes.DECnet@cesar. sedalia.sinet.slb.com Subject: Re: A patch to add builtin read (small bug) In-Reply-To: Your message of "Tue, 21 Sep 1993 23:11:29 +0200." Reply-To: vons@cesar.crbca1.sinet.slb.com Date: Thu, 23 Sep 1993 03:30:58 -0400 | The diffs assume you've been keeping up with the bug |fix patches posted here. (If anyone wants a complete set of diffs |against a virgin copy of 1.4 let me know and I'll mail it to you.) The patch dropped in nicely in my virgin 1.4, no problems. I was just wondering about the following case: ; x=(foo bar) ; read x < /dev/null ; echo $status 1 ; whatis x x=(foo bar) This suggests that something has been read before encountering EOF, which is obviously not the case, so I assume the read should set x to ''. |For Chris, if you don't care about setting a different ifs, you can |split the line without a fork by using eval: | read x;eval 'x=('$x')' This doesn't work: ; read x;eval 'x=('$x')' a line with a # in the middle line 1: syntax error near eof ; ; read x;eval 'x=('$x')' a line with a = in the middle line 1: syntax error near '=' ; The 'trick' with the echo works however, fork()-ing every time: ; read x; x= `{echo $x} a line with a # in the middle ; whatis x x=(a line with a '#' in the middle) ; If a read function is added, why not make it a bit more practical by using $ifs? If makes it more useful, and the code above a bit more elegant. I wouldn't mind adding this myself, but I'm not too familiar with the rc internals. Gert-Jan --------------------------------------------------- J.G. Vons E-Mail: vons@cesar.crbca1.sinet.slb.com