From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5798 invoked from network); 25 Mar 1999 12:03:11 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Mar 1999 12:03:11 -0000 Received: (qmail 20791 invoked by alias); 25 Mar 1999 12:02:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5935 Received: (qmail 20783 invoked from network); 25 Mar 1999 12:02:44 -0000 From: "Andrej Borsenkow" To: "Sven Wischnowsky" , Subject: ${...:-...} again and subst clarification E: PATCH: param stuff and was: PATCH: 3.1.5-pws-12: _brace_parameter Date: Thu, 25 Mar 1999 15:00:06 +0300 Message-ID: <002201be76b7$063c9940$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 In-Reply-To: <199903161150.MAA25602@beta.informatik.hu-berlin.de> Importance: Normal > > > > > > 1) let it treat the `bar' always as a string (i.e. let it never be > > > split into array elements); I guess this is what most people > > > would expect (and in the manual the thing is called `word') > > I just found, that ${...:-...} does not work with arrays at all bor@itsrm2:~%> foo=() bor@itsrm2:~%> bar=(c d) bor@itsrm2:~%> args ${foo:-${bar}} 0 bor@itsrm2:~%> args ${foo-${bar}} 0 If this was intended, then this change is really O.K and does the right thing. But then, it should explicitly be mentioned in manuals. The same applies to words after %, #, /, = (without (A)) and to val in FOO=val as well. In all these contexts array value is forced (joined) to scalar. May be, it is needed to be explicitly stated as well (to avoid confusion). ${...=...} case is mentioned - but, probably, it would be better to have them explained in rules in the correct place - even more so, as the way it is done is again inconsistent: bor@itsrm2:~%> setopt shwordsplit bor@itsrm2:~%> IFS="$IFS:" bor@itsrm2:~%> foo=("x:y" "a:b") bor@itsrm2:~%> bar=$foo bor@itsrm2:~%> print "$bar" x:y a:b No word splitting. The same applies to #, % and /. bor@itsrm2:~%> yyy=${xxx:-$foo} bor@itsrm2:~%> print "$yyy" x y a b $foo is wordsplitted. the same with =. cheers /andrej