Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
feature request: (pat1&pat2) glob and @(pat1&pat2) kshglob
- X-seq: zsh-workers 41888
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: feature request: (pat1&pat2) glob and @(pat1&pat2) kshglob
- Date: Sat, 14 Oct 2017 10:02:44 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=kzZ6dDj0XzmiXHYxvhFLVw2cGJTNJ6iGGV7vf2OMpbQ=; b=Qj/fVXaKmLpAijVPxBa0SI0VwOTFhQA9EJPAFL9LPMyGCWpa8t5tldYeyH4XEKujcb /Iv8BY+g5fGOrjNLwYmh0DdOEWGmu9Qxnnap2pD4nRxTB6Ta+R7w+e7EJ7OjPEMCM3Kg 6nJA9gC8ZCTzsVXpvbaFdhjyjCBp63dITHiwuOJDymo1LCJ451hQ3Xt5ddb6tZVF7rhu rhQvBVGQxuiALITTLvNi9jhpMr/WQe+OImRjRT2IWT3JQFBWMbyNQgooZVpVNITzeObb +2kp7fKyKHU/FO9/5cR7Iw4ZbREb/ttbOGrtDicJ/CQA2xE86avIsFFuDRgED0jbaV9T NxxQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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