zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: PATCH: Re: Shell-word splitting (was: Re: Proposed _history completer)
Date: Wed, 03 May 2000 13:54:37 +0100	[thread overview]
Message-ID: <0FTZ007NIIJ0KU@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: "Your message of Wed, 03 May 2000 14:20:33 +0200." <200005031220.OAA00376@beta.informatik.hu-berlin.de>

> 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 <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


  parent reply	other threads:[~2000-05-03 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-03 12:20 Sven Wischnowsky
2000-05-03 12:38 ` Andrej Borsenkow
2000-05-03 12:54 ` Peter Stephenson [this message]
2000-05-03 13:03 Sven Wischnowsky
2000-05-03 15:06 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0FTZ007NIIJ0KU@la-la.cambridgesiliconradio.com \
    --to=pws@cambridgesiliconradio.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).