Documentation ? wildcard

rps

Jul 6, 2008
300
4
#1
The way I understand the help on using the "?" wildcard would display both the tcmd21.tws and tcmdv21.tws files. As this block shows that is not the case. What is the proper syntax to display both files using a "?" wildcard?
I have also attempted this in Version 17,19 & 20 with no joy.
Code:
c:\jpsoft\tcmd21x64>ver
TCC  21.01.53 x64   Windows 10 [Version 10.0.15063]

v21.01.53
c:\jpsoft\tcmd21x64>*dir /Nhs tcmd*21.tws
10/08/2017  13:07           2,539  tcmd21.tws
10/08/2017  13:07           2,539  tcmdv21.tws

v21.01.53
c:\jpsoft\tcmd21x64>*dir /Nhs tcmd?21.tws
10/08/2017  13:07           2,539  tcmdv21.tws
If this is according to design then I suggest the Help file for "Question mark ?" wildcard be updated. Specifically:

"Extra" question marks in your wildcard specification are ignored if the file name is shorter than the wildcard specification. For example, if you have files called LETTER.DOC, LETTER1.DOC, and LETTERA.DOC, this command will display all three names:

dir letter?.doc

The file LETTER.DOC is included in the display because the "extra" question mark at the end of LETTER? is ignored when matching the shorter name LETTER.

Yes this example still works but the explanation is insufficient, since the example doesn't clarify that only characters after the "." can follow the single ignored question mark. In fact if a file name LTTERA.DOC exists and the command *dir l?tter?.doc the LTTERA.DOC file will NOT be listed. Showing that the 1st ? is not ignored.
Code:
v21.01.53
c:\jpsoft\tcmd21x64>*dir /Nhs ltter?.doc
10/08/2017  13:57              42  ltterA.doc
v21.01.53
c:\jpsoft\tcmd21x64>*dir /Nhs l?tter?.doc
10/08/2017  13:57              42  letter.doc
10/08/2017  13:57              42  letter1.doc
10/08/2017  13:57              42  letterA.doc
This being the case I believe that further explanation, in the help, is need to demonstrate when the ? is ignored and when it isn't.
 

rps

Jul 6, 2008
300
4
#4
This is normal Windows (and CMD) behavior, not anything specific to TCC.

A single ? in the middle (not the end) of a filename must match a single character. If you want to match 0 or more characters, you need to use either * or a regular expression.
Got it. I'm usually very literal, but I totally missed the significance of ... extra question mark at the end ....
Thanks for the clarification. No longer a documentation problem, just another user misunderstanding. :oops:

Thanks to you I have been using TCC for so long I don't know much about CMD behavior.