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

Re: whence question



On Sat, 14 Jan 2017, Jens Elkner wrote:

> especially in 'for' like statements, dropping it silently makes sense
> (is expected). To accomplish this in an easy way, ksh93 allows one to
> prefix the pattern with '~(N)' , e.g.:
>
> Would be nice, if zsh could do the same (and enhance compatibility) ...

Zsh has had this for many years, except you suffix the pattern rather
than prefix it and there's no extra "~":

    for F in *.c(N) ; do ls $F ; done

Zsh can't readily adopt ksh's exact syntax here because ~(N)*.c is taken
to be a pattern grouping, e.g. ~(N|M)*.c would match home directories
for user names beginning with N or M and ending in .c.



Messages sorted by: Reverse Date, Date, Thread, Author