zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [patch] Fix VCS_INFO_reposub's whitespace handling
Date: Sun, 28 Sep 2014 18:39:19 +0100	[thread overview]
Message-ID: <20140928183919.76bbfcbb@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20140928171033.GA11234@cheyenne>

On Sun, 28 Sep 2014 19:10:33 +0200
Marco Hinz <mh.codebro@gmail.com> wrote:
> Could someone point me to the appropriate parameter expansion rule?

In

${$(pwd -P)#$base/}

you're hitting the special rule applied to the command substitution
rather than the parameter substitution.

Zsh is actually less likely (by default) to split substitutions than
other shells, but for $(...) it works the same way other shells do.  You
wouldn't hit this just with parameter substitution unless you had the
option SH_WORD_SPLIT set.  See the section COMMAND SUBSTITUTION in the
zshexpn manual page.  The second sentence is the exact rule.

The only effect parameter substitution has on the result is the explicit
one, i.e. removing $base/ from the head of the nested result.  If you
want the full hairy list of parameter rules (hint: you don't) search for
"brain damage" in zshexpn.

For nested operations involving command substitions, the description is
a couple of paragraphs above "Parameter Expansion Flags".  The following
paragraph, indicating you can double-quote just the nested command
substitution, is also relevant (your patch looks fine as it is since
we're dealing throughout with one word).

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2014-09-28 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-28 17:10 Marco Hinz
2014-09-28 17:39 ` Peter Stephenson [this message]
2014-09-28 18:52 ` Bart Schaefer
2014-09-29 12:23 ` [PATCH] Fix VCS_INFO_reposub's command expansion Frank Terbeck
2014-09-29 13:26   ` 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=20140928183919.76bbfcbb@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /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).