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 <2461>; Fri, 17 Sep 1993 09:55:49 -0400 Received: from snmrtr.psi by SINet.SLB.COM id AA24431; Fri, 17 Sep 93 13:58:30 GMT From: gjv%atlas%cesar@crbca1.SINet.SLB.COM Message-Id: <9309171358.AA24431@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); Fri Sep 17 15:54:37 1993 MET DST Received: from pyxis by atlas.atlasnis (4.1/SMI-4.1-DNI) id AA12228; Fri, 17 Sep 93 15:54:04 +0200 To: rc%hawkwind.utcs.toronto.edu%m_internet%m_mailnow%hermes.DECnet@cesar. sedalia.sinet.slb.com Subject: Re: builtin read In-Reply-To: Your message of "Fri, 17 Sep 1993 15:36:01 +0200." Reply-To: vons@cesar.crbca1.sinet.slb.com Date: Fri, 17 Sep 1993 09:54:29 -0400 |I have not decided yet wether a builtin read is a good idea or not. |Meanwhile let me help you with this | | for( line in `` ($nl) { cat /some/file }){ | words = `{ echo $line } | } Agreed, it looks better than what I came up with, but my objections remain the same. You still need to fork&exec a cat, and it remains a bit cludgy IMHO. |But I don't understand how your second solution works because there |must be something wrong with input redirection. My rc behaves like this: | | ; while( echo outside ){ echo inside } > /dev/null | outside | outside | .. Oops, typo in my mail I guess, forgot the accolades around the whole while+body. Applying it to your example, it becomes ; { while (echo outside) {echo inside} } > /dev/null which works as I intended. I'm not yet convinced though, a builtin read makes the shell more complete IMHO, not to mention that it would make it easier to pass scripts around. If someone else wants to use a script of mine, who guarantees that he/she has an identical read function in his environment, and in case I add a read function to my script, should I use awk, "sh -c 'read a;echo $a'", /usr/bin/line, ... ???? And I think that performance is a reasonable argument here as well. Gert-Jan --------------------------------------------------- J.G. Vons E-Mail: vons@cesar.crbca1.sinet.slb.com