Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] () { echo $#} $'' is zero
- X-seq: zsh-users 21346
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: [bug] () { echo $#} $'' is zero
- Date: Thu, 3 Mar 2016 15:34:36 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=IUu9238bJoPrsU2SDBy831FCkuLRwVoL6Em5lGx24qE=; b=HTzBEOOP8q3QpfS1KTm+NEuqOT8hNL2TNRCFqYXbal7smqSDkn0mrnsdvfufC3GQvy 5J3Wglq0a1hxyE20/Ml/PPQ36mTKUogYiOVMJXSDyTumaotH3YHIdfUojeh38+kVc0z+ QA9iQ1tDUbtPxsh46IBrofi8BZWzMkqHB5DRgvvstyseWWVy9nTtYGsSQtig6zxWBgzH WoTp/NW95uIfHWCEcVV8HmHq2/REvrtzmNISxVo5HjIsMunfuAVg9nqFc74yVlpO+qTA BbOle+7gEUHrTiChvC5tFfLxvxgHhMsuNWUTSvhwIqHPVNZp8flkHjd4PdUKBpTl9iwM EdJg==
- In-reply-to: <1533e4d3e82.cbf3800a134118.3897690426664036468@enosys.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <1533e4d3e82.cbf3800a134118.3897690426664036468@enosys.org>
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 -- ''
This does appear to be out of step with other shells. Follow-ups to
zsh-workers.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author