From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7223 invoked from network); 6 Jun 2001 13:49:15 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jun 2001 13:49:15 -0000 Received: (qmail 6909 invoked by alias); 6 Jun 2001 13:48:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14762 Received: (qmail 6892 invoked from network); 6 Jun 2001 13:48:55 -0000 Date: Wed, 6 Jun 2001 09:48:57 -0400 From: Clint Adams To: Andrej Borsenkow Cc: Zsh hackers list Subject: Re: Export problem Message-ID: <20010606094857.A23921@dman.com> References: <20010606035125.B8915@dman.com> <001901c0ee61$3995a240$21c9ca95@mow.siemens.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <001901c0ee61$3995a240$21c9ca95@mow.siemens.ru>; from Andrej.Borsenkow@mow.siemens.ru on Wed, Jun 06, 2001 at 12:18:11PM +0400 > What do you mean "more or less"? Was 14716 unclear? "Variable assignment" is What I meant was that my paraphrasing of the spec could perhaps imply more or less than would a verbatim quote. > strictly defined grammar construct. No more and no less. In > > foo=bar bla bla bar=baz > > foo=bar is variable assignment and bar=baz is command argument. I don't dispute that. > - in ${x:=word} word is *never* splitted irrespectively of where it appears > and if it is quoted Where is that stated? > - x=word is not splitted (should I add "never"?) Where is that stated? Your quote of SUS (which is lifted from POSIX) said that each variable assignment undergoes expansion in step 4, including parameter expansion and command substitution. In addition, the bit about Field Splitting says that "the shell shall scan the results of expansions and substitutions that did not occur in double-quotes for field splitting and multiple fields can result." It then goes on to talk about IFS and how splitting is to occur. I also don't see any exceptions or proscriptions against splitting when variable assignment is involved. > - in export x=word the whole `x=word' is field splitted unless quoted. That seems fairly straight-forward, but I don't understand the intended effect. The output of field splitting is "fields." The input is whatever results from the expansion or substitution of "words." Does POSIX define these things? If `date +%z%f` expanded to "-0400; rm -rf .", what should export THIS=`date +%z%f` do? a) export THIS with the value "-0400; rm -rf ." b) export THIS with the value "-0400; rm -rf ." as an array of 4 words? POSIX doesn't seem to acknowledge the concept of arrays in the Shell Command Language. c) export THIS with the value "-0400;" and try to export parameters named "rm", "-rf", and "."? d) retokenize the line and treat it as a sequential list of two commands?