Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why are empty elements removed from array expansion?
- X-seq: zsh-users 15670
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Why are empty elements removed from array expansion?
- Date: Thu, 23 Dec 2010 08:21:39 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=24a6dFg+v4+tGX2/PJJrwmTkcuLTJzH6mJ9tV6I0PYY=; b=AXQSzub2i075caEL0tyaJK2hoSfmhIUCfStagjwn2KaxUauuskzN1p71GvqqHZVnaF FuOb6phSapXMNKXvwGH935qcR8mEsjHfnupBZuk0gvZW/Rp/ow2EPllbAEntxkGu/QST oMkuAVzT2MYb6M8E+wf0czDNEdrtpPk69u6n8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=wj0Cdk3/sRGUzoYpVRAV5e4qSIuan4u/bL4HYyYx3WRiOyi3pBj9wbCOqaYpBi2LHP iKuzkkdeZbRKgXsBZw72japOmoKAkng1YOCJ3uGY5+jZOn+ZURtbA/QxCMC8rNeAzfwP yLqmHbC6YXhfBnPpSKLi5TDwa6NatIc0WWAaM=
- In-reply-to: <101222230927.ZM21944@xxxxxxxxxxxxxxxxxxxxxx>
- 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: <AANLkTik5Lc-57VHSkwOE6v2q=tM24N_0DWbXgTsrATDp@xxxxxxxxxxxxxx> <101222230927.ZM21944@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On Thu, Dec 23, 2010 at 08:09, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Dec 22, Â9:46pm, Nikolai Weibull wrote:
> } Subject: Why are empty elements removed from array expansion?
> This is thus a "principle of least surprise" issue -- not what least
> surprises *you*, as a programmer expecting certain rigid rules, but
> what least surprises an inexpert shell user trying to figure out why
> "cat $a" says that the empty string can't be opened as a file.
Itâs sad that I have to pay the tax for such users.
Is this the same reasoning behind the fact that empty string variables
are removed as arguments as well?
% a=
% print -l $a $a
% print -l "$a" "$a"
%
This is, speaking as a programmer, perhaps even worse.
Thank you for your explanation.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author