From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay2.UU.NET ([192.48.96.7]) by hawkwind.utcs.toronto.edu with SMTP id <2223>; Tue, 21 Sep 1993 13:20:24 -0400 Received: from spool.uu.net (via LOCALHOST) by relay2.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA15915; Tue, 21 Sep 93 12:17:06 -0400 Received: from srg.UUCP by uucp4.uu.net with UUCP/RMAIL (queueing-rmail) id 121557.5331; Tue, 21 Sep 1993 12:15:57 EDT Received: from ceres.srg.af.mil by srg.srg.af.mil id aa02967; Tue, 21 Sep 93 11:54:44 EDT From: culliton@srg.af.mil (Tom Culliton x2278) X-Mailer: SCO System V Mail (version 3.2) To: rc@hawkwind.utcs.toronto.edu Subject: Re: Thoughts on a builtin read Date: Tue, 21 Sep 1993 11:54:45 -0400 Message-Id: <9309211154.aa16146@ceres.srg.af.mil> Oh, where to start.... Rich is right about the patch for nalloc.c, his version is better style. For Malte, simplicity is often the same as usability, it takes a lot fewer brain cells to remember and correctly use something simple vs. something complex. Maybe I'm just getting old, but I find myself running low on brain cells pretty regularly these days. What really convinced me that rc's read should be simple was looking at the one in ksh. What a monstrosity! 8-P The other idea that Malte mentioned, having read act like line, does have a certain appeal. It's may even be cleaner because it doesn't add another way of setting variables. And as Alan points out, a simple function can easily convert one form to the other. The only problem is that you always need a `{} and thus an extra fork to do anything with it. 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')' Of course if you want to split up the fields of /etc/passwd on ':' you'll still need to fork. Producing your own version of read, that splits the input line using ifs, should be easy if you generalize the backquote code in glom.c. Go for it! ;-) Finally, Alan has given me the go ahead to repost his version of read as a patch. The current version doesn't support readline yet, so maybe I'll try to hack that in after lunch. Tom