Wildcard question

#1
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
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,619
46
Albuquerque, NM
prospero.unm.edu
#2
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.[?]*
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,619
46
Albuquerque, NM
prospero.unm.edu
#3
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"....)
 

rconn

Administrator
Staff member
May 14, 2008
10,588
97
#5
Below, should doggy.txt have been deleted?
Yes -- try it in CMD, and see the same results.

If you don't want the Windows "match one or more characters unless at the end of the name or extension, in which case also match 0 characters" behavior, use regular expressions instead. They tend to be much more predictable!