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

feature request: (pat1&pat2) glob and @(pat1&pat2) kshglob



Hi,

ksh93 has a @(pat1&pat2) glob operator. Useful (though not
often I have to admit) for things like: @(????&*a*) for 4-char
file names that contain a "a".

It can currently be emulated with extendedglob:

????~^*a* or ^(^????|^*a*) (or !(!(????)|!(*a*)) kshglob
equivalent) but those are less obvious and require extendedglob.

Since (pat1&pat2) is currently a syntax error and & is not a
glob qualifier, it would be safe to add it even outside
extendedglob like for (pat1|pat2).

Like for (pat1|pat2), we'd want to have *(foo&bar) not be
treated as a glob qualifier.

Adding a @(pat1&pat2) kshglob would improve compatibility with
ksh93 in ksh emulation.

-- 
Stephane



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