Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: FEATURES description wrong line
- X-seq: zsh-workers 27370
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: FEATURES description wrong line
- Date: Sun, 8 Nov 2009 19:48:26 +0000
- Cc: Zsh-Workers <zsh-workers@xxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=a5V+WA97qCigQ/nVAK5Yji3vIAJguPUxtoOGqv6FDXl2xTgWbyGw1Y4t8BGEof4v/6MxpIApWCxXGGYlsH3JgOk9B6O9mlwe0QD2BgAKBDBrmQ8ZNairrruiJcsG9OYqVKwBtRdPDRolvYWWN1uAcHfLqt74B1SyqD8UL7QxRFY= ;
- In-reply-to: <091108090815.ZM24393@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh-Workers <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20091108114904.GA7063@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <091108090815.ZM24393@xxxxxxxxxxxxxxxxxxxxxx>
2009-11-08 09:08:15 -0800, Bart Schaefer:
> On Nov 8, 12:49pm, Maddi Kopfermann wrote:
> }
> } I read in "FEATURES" and found some wrong line:
> }
> } "ls *(om[2]) matches the two most recently modified files"
> }
> } I am very thankful that this FEATURE isn't there ;)
> } Would confuse me very much :)
>
> Good catch, that matches the second-most-recently modified file. To get
> the two most recently modified, you need *(om[1,2]) ... but that's not
> exemplary enough if you ask me, because it makes it appear you have to
> list all the indices.
[...]
By the way, what about having the empty string (or any sequence
of white space) resolve to 0 in numeric context everywhere?
We already have:
$ echo $(())
0
$ (()) || echo null
null
$ [ 0 -eq "" ] && echo yes
yes
$ a=; echo $(( a == 0 ))
1
AT&T ksh and pdksh have:
$ a=1 pdksh -c 'echo ${a[]}'
1
zsh could have the same and also *(om[,2]) would be another way
to get the 2 most recent files, what do you think?
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author