Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: Globbing for Empty Directories?
- X-seq: zsh-workers 19743
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: Re: Globbing for Empty Directories?
- Date: Tue, 6 Apr 2004 10:55:07 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <20040401184336.DC34B8646@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <9E7AF602-8085-11D8-AA68-000502631FBD@xxxxxxxxxxxxxx> <20040401184336.DC34B8646@xxxxxxxxxxxxxxxxxxxxxxxx>
I thought it would be nice to test the new 'F'ull-directory glob
modifier, so I'm planning to commit these changes to D02glob.ztst.
..wayne..
--- Test/D02glob.ztst 3 Dec 2003 10:54:36 -0000 1.3
+++ Test/D02glob.ztst 6 Apr 2004 17:33:46 -0000
@@ -2,8 +2,8 @@
%prep
mkdir glob.tmp
- mkdir glob.tmp/dir1
- mkdir glob.tmp/dir2
+ mkdir glob.tmp/dir{1,2,3,4}
+ mkdir glob.tmp/dir3/subdir
: >glob.tmp/{,{dir1,dir2}/}{a,b,c}
globtest () { $ZTST_testdir/../Src/zsh -f $ZTST_srcdir/../Misc/$1 }
@@ -265,11 +265,11 @@
( regress_absolute_path_and_core_dump )
0:exclusions regression test
>
->glob.tmp/a glob.tmp/b glob.tmp/c glob.tmp/dir1 glob.tmp/dir1/a glob.tmp/dir1/b glob.tmp/dir1/c glob.tmp/dir2 glob.tmp/dir2/a glob.tmp/dir2/b glob.tmp/dir2/c
+>glob.tmp/a glob.tmp/b glob.tmp/c glob.tmp/dir1 glob.tmp/dir1/a glob.tmp/dir1/b glob.tmp/dir1/c glob.tmp/dir2 glob.tmp/dir2/a glob.tmp/dir2/b glob.tmp/dir2/c glob.tmp/dir3 glob.tmp/dir3/subdir glob.tmp/dir4
print glob.tmp/*(/)
0:Just directories
->glob.tmp/dir1 glob.tmp/dir2
+>glob.tmp/dir1 glob.tmp/dir2 glob.tmp/dir3 glob.tmp/dir4
print glob.tmp/*(.)
0:Just files
@@ -281,7 +281,7 @@
print glob.tmp/**/(:h)
0:Head modifier
->. glob.tmp glob.tmp
+>. glob.tmp glob.tmp glob.tmp glob.tmp glob.tmp/dir3
print glob.tmp(:r)
0:Remove extension modifier
@@ -289,5 +289,16 @@
print glob.tmp/*(:s/./_/)
0:Substitute modifier
->glob_tmp/a glob_tmp/b glob_tmp/c glob_tmp/dir1 glob_tmp/dir2
+>glob_tmp/a glob_tmp/b glob_tmp/c glob_tmp/dir1 glob_tmp/dir2 glob_tmp/dir3 glob_tmp/dir4
+ print glob.tmp/*(F)
+0:Just full dirs
+>glob.tmp/dir1 glob.tmp/dir2 glob.tmp/dir3
+
+ print glob.tmp/*(^F)
+0:Omit full dirs
+>glob.tmp/a glob.tmp/b glob.tmp/c glob.tmp/dir4
+
+ print glob.tmp/*(/^F)
+0:Just empty dirs
+>glob.tmp/dir4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author