From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from techfac.TechFak.Uni-Bielefeld.DE ([129.70.132.100]) by hawkwind.utcs.toronto.edu with SMTP id <2192>; Tue, 21 Sep 1993 11:56:31 -0400 Received: from dahlie.TechFak.Uni-Bielefeld.DE by techfac.TechFak.Uni-Bielefeld.DE id AA16587; Tue, 21 Sep 1993 17:56:18 +0200 Received: by dahlie.techfak.uni-bielefeld.de (5.0/tp.29.0890) id AA20736; Tue, 21 Sep 93 17:56:15 +0200 Date: Tue, 21 Sep 1993 11:56:15 -0400 From: malte@TechFak.Uni-Bielefeld.DE Message-Id: <9309211556.AA20736@dahlie.techfak.uni-bielefeld.de> To: rc@hawkwind.utcs.toronto.edu Subject: Re: Thoughts on a builtin read [ rsalz@osf.org wrote ]: Anyhow, let's take a look at your idea. That is, x=`foobar hould set $status to the exit value of foobar. What should x=foobar set $status to? Leave it unchanged? What about x=* if the directory is empty? And if it isn't? What about x=/foo/* when /foo doesn't exist? Yes, an assignment leaves the status unchanged. Your file name expansion examples are just a shorthand for x = `{ glob /foo/* } # glob == echo Currently, neither "x=*" nor "x=`{ glob *}" sets $status to some reasonable value, it is just 0 -- always! You are making a simple shell very complicated, don't you think? Complicated is your word for it, I'd rather call it more usable. I have frequently had the problem to distinguish between a failed backquote command and a command producing no output. There may be better solutions then this x = `{ foo || echo '!@#$%^&*()' } if( ~ $x '!@#$%^&*()' ) ... but it seems to me to be a FAQ. The person who started this thread had just this problem. I don't mean to offend anybody, but I have the impression that because Tom Duff invented this shell there can't be anything wrong. But if one takes a closer look, one sees quite a few sh'isms still in it, e.g shift. I think rc in its original form and in its current form is an excellent point to start a shell project. This is why I post all this to this list and have it discussed instead of just implementing it for myself. Be assured though, that I very much appreciate different opinions. Back to the read problem: Currently there is no builtin which assigns a value to a variable ( except for the special variables of course ). There's been a discussion on shift shifting arbitrary lists with the proposed syntax being "shift x 2" probably because "x = `{ shift x 2 }" isn't too elegant. If this makes its way into rc, I don't mind if read expects a variable as a command line parameter. But since I don't care if some functionality is built into the shell, I'd prefer the backquote substitution solution. Malte