3

I wanna find *.cs and *.cpp files through cleartool find command. But it failed.

cleartool find "M:\test_view\code" -name "*.cs *.cpp"  -print

Nothing can be found based on above even there are matched files in that folder.

How to set multiple file-name patterns ?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Meng
  • 85
  • 1
  • 4

3 Answers3

3

The query language offer some possibility for Compound queries (query || query)

But the cleartool find has none of those operators for the -name option.

The best you can do, following the cleartool wildcard syntax, is

cleartool find "M:\test_view\code" -name "*.c[sp]*" -print
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • All right, the documentation **is** there, it's just well hidden. I'll try to stay away from things I'm not familiar with. – MvanGeest Jul 27 '10 at 14:01
  • @MvanGeest: no problem ;) Your answer was well intentioned (I remember trying myself those same options with the `cleartool find` a few years ago), but that 'find' is really a different beast from the Gnu one. – VonC Jul 27 '10 at 15:22
1

This is a bit late but perhaps this will help someone. One option is to wrap this is a for loop:

    :: namelist.txt contains a list of file types  ( *.cs, *.cpp, )

FOR /F "tokens=1" %%A IN (c:\bin\namelist.txt) DO ( cleartool find "M:\test_view\code" -all -type f -name %%A -print)
canadian_scholar
  • 1,315
  • 12
  • 26
emptyshell
  • 103
  • 1
  • 13
-1

It lookslike cleartool wraps the unix style find utility.

If that is right you might be able to use '-or'

$ find -type f -name '*.cs' -or '*.cpp' -print
IanNorton
  • 7,145
  • 2
  • 25
  • 28