From 10ae77c0cfee1e15fe062ee5a6d8a4b31304d58a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 1 Jun 2014 14:18:21 -0700 Subject: users/18857: add (Y) glob qualifier to generate only one match per pattern --- Test/D02glob.ztst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Test') 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 -- cgit 1.4.1