From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from oldp.astro.wisc.edu ([128.104.39.15]) by hawkwind.utcs.toronto.edu with SMTP id <2645>; Mon, 7 Jun 1993 13:10:26 -0400 Received: by oldp.astro.wisc.edu (5.65/DEC-Ultrix/4.3) id AA08381; Mon, 7 Jun 1993 12:10:17 -0500 Message-Id: <9306071710.AA08381@oldp.astro.wisc.edu> To: haahr@mv.us.adobe.com (Paul Haahr) Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: redirection and built-ins Date: Mon, 7 Jun 1993 13:10:16 -0400 From: Alan Watson X-Mts: smtp Paul writes: > it's inappropriate because rc already has a perfectly good > mechanism for setting variables to the output of commands: backquotes. > why is that not enough? what functionality does that lack? Oh, the ability to encapsulate the process in a function (yes, I know that in es one could pass a program fragment, but this is the rc-list after all), and an easy way to get at the return value (yes, I know that may be fixed in a later version, but I'd still rather hide the grubby details in a function). > what does this mean? (``functionally-implemented''? that it works? > that it doesn't have side effects?) It means `implemented as a function'. > the mechanism we came up with for doing this [redirection on > built-ins without forking] in > es could be applied to rc just fine, but it seems like a lot of > work for very little payoff. Fine. I'm prepared to accept that answer; as I said in my original message, I'm only interested in exploring the possibilities, and I am not campaigning for either of these changes. I'm not concerned about the performance aspects, only the functionality. > what should happen if the command is > exit 1 | exit 2 | exit 3 > ? There will always be pathological cases: even now, if you have an exit in a function and run it with and without redirection, different things happen. I haven't heard of anyone losing any sleep about it.