Meng
Meng

Reputation: 85

clearcase: find -name not allow multiple patterns?

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 ?

Upvotes: 3

Views: 1634

Answers (3)

emptyshell
emptyshell

Reputation: 103

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)

Upvotes: 1

VonC
VonC

Reputation: 1323553

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

Upvotes: 3

IanNorton
IanNorton

Reputation: 7282

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

Upvotes: -1

Related Questions