From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20152 invoked from network); 3 May 2000 12:55:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 May 2000 12:55:31 -0000 Received: (qmail 2620 invoked by alias); 3 May 2000 12:55:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11116 Received: (qmail 2610 invoked from network); 3 May 2000 12:55:04 -0000 Date: Wed, 03 May 2000 13:54:37 +0100 From: Peter Stephenson Subject: Re: PATCH: Re: Shell-word splitting (was: Re: Proposed _history completer) In-reply-to: "Your message of Wed, 03 May 2000 14:20:33 +0200." <200005031220.OAA00376@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FTZ007NIIJ0KU@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT > Anyway, here's the patch, implementing the (z) flag which makes the > parameter value be zplitted uzing zsh zhell zyntax. This works a bit > like the (s) flag (or the `=' before the name) and is done at the very > end, so to access words resulting from the splitting: > > % foo='it says: "hello world"' > % echo ${${(z)foo}[3]} > "hello world" > > We could probably move the code that does the splitting up somewhere > but it would then behave more differently from (s) and = than it does > now, so that would probably be a bad idea. This is probably right, but it could do with mentioning explicitly, including in the rules for parameter substitution, otherwise it's a little non-obvious that you can't do e.g. ${(Qz)foo} to get rid of the quotes. You can do ${(Q)${(z)foo}}, so it's no problem as long as you know about it. -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070