zsh-users
 help / color / mirror / code / Atom feed
From: Philippe Troin <phil@fifi.org>
To: zsh-users@zsh.org
Subject: Re: [bug] () { echo $#} $'' is zero
Date: Thu, 03 Mar 2016 23:16:13 -0800	[thread overview]
Message-ID: <1457075773.23627.11.camel@ceramic.home.fifi.org> (raw)
In-Reply-To: <160303153436.ZM31948@torch.brasslantern.com>

On Thu, 2016-03-03 at 15:34 -0800, Bart Schaefer wrote:
> On Mar 3,  3:16pm, Ryan Wilson wrote:
> } Subject: [bug] () { echo $#} $'' is zero
> }
> } Subject says it all. The empty string $'' is not passed to commands the same
> } way the empty strings "" and '' are:
> 
> $'...' is not a quoted expression, it's a substitution (at least as far
> as zsh is concerned).  It behaves like expanding a $parameter reference,
> except that the value is the string inside the '...' part.
> 
> Thus
>     set -- $''
> is more akin to
>     x=''
>     set -- $x
> than to
>     set -- ''

Well not really.
        % echo $param $'<\n>'
        value <
        >
        % echo "$param $'<\n>'"
        value $'<\n>'

It behaves like $parameter, but definitely not within double
quotes... ;-)

Phil.


      reply	other threads:[~2016-03-04  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 21:16 Ryan Wilson
2016-03-03 22:33 ` Martijn Dekker
2016-03-03 23:34 ` Bart Schaefer
2016-03-04  7:16   ` Philippe Troin [this message]

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=1457075773.23627.11.camel@ceramic.home.fifi.org \
    --to=phil@fifi.org \
    --cc=zsh-users@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).