Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Wildcard question

May
12,930
170
Below, should doggy.txt have been deleted?
Code:
v:\> del doggy.txt.*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.?*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.??
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
Below, should doggy.txt have been deleted?
Code:
v:\> del doggy.txt.*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.?*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.??
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted


Have you tried this?

Code:
DEL DOGGY.TXT.[?]*
 
Or, probably more appropriate to what you're trying to do:

Code:
del doggy.txt[.]*

The [.] only matches an actual period character. (I presume TCC's somewhat surprising behavior is meant to accommodate the die-hard DOSheads who continue to use *.* to mean "all files"....)
 
Have you tried this?

Code:
DEL DOGGY.TXT.[?]*
Yes, and that works. I had to write a little program to remind myself how the Win32 FindFirstFile/FindNextFile functions worked. Indeed, according to them, "doggy.txt" matches "doggy.txt.??".
 

Similar threads

Replies
3
Views
2K
Back
Top