diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2014-06-01 14:18:21 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2014-06-01 14:18:21 -0700 |
commit | 10ae77c0cfee1e15fe062ee5a6d8a4b31304d58a (patch) | |
tree | 98f365155cfee78015cef217bcdabd9e8b272cc6 /Test | |
parent | 501f2003a89673cebc956ec5aa5f4f401b3a8f5f (diff) | |
download | zsh-10ae77c0cfee1e15fe062ee5a6d8a4b31304d58a.tar.gz zsh-10ae77c0cfee1e15fe062ee5a6d8a4b31304d58a.tar.xz zsh-10ae77c0cfee1e15fe062ee5a6d8a4b31304d58a.zip |
users/18857: add (Y) glob qualifier to generate only one match per pattern
Diffstat (limited to 'Test')
-rw-r--r-- | Test/D02glob.ztst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst index 3e1ea8210..d197098b6 100644 --- a/Test/D02glob.ztst +++ b/Test/D02glob.ztst @@ -431,6 +431,7 @@ mkdir glob.tmp/dir5 touch glob.tmp/dir5/N123 print glob.tmp/dir5/N<->(N) + rm -rf glob.tmp/dir5 0:Numeric glob is not usurped by process substitution. >glob.tmp/dir5/N123 @@ -541,3 +542,13 @@ >No file beginning with z >Multiple files matched >Normal string if nullglob not set + + (){ print $#@ } glob.tmp/dir*(Y) + (){ print $#@ } glob.tmp/file*(NY) + (){ [[ $1 = glob.tmp/dir? ]] && echo "(Y) returns a matching filename" } glob.tmp/dir*(Y) + (){ print $@:t } glob.tmp/dir*(Y^Y) +0:short-circuit modifier +>1 +>0 +>(Y) returns a matching filename +>dir1 dir2 dir3 dir4 |