Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: FEATURES description wrong line



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