I would like to list the available labels matching a particular string applied in the view.
2 Answers
I confirm a filter in cleartool find
is not possible:
ct find . -ele "lbtype_sub(My_LAB*)" -print
would not work (no wildcard in query argument.
If you cannot use a grep in a shell pipe, can you consider using grep in an exec part of a find, like in this example?
ct find . -kind lbtype -exec "echo %CLEARCASE_PN%|grep MY_LAB"
If this is not acceptable, you need to write the result in a file and process it with another tool (sed?)
You have packages for Windows including Unix commands: see this SO question.
Of you have freeware emulating the grep command.
If you must stay with native Windows commands, you must redirect the result in a file, and use FIND (English translation).
-
Thanks , this is running on windows , hence was in need of excluding the grep. – Raj Jul 27 '10 at 10:46
-
@Raj: you can install packages including Unix-like command on Windows: see http://stackoverflow.com/questions/247234/do-you-know-a-similar-program-for-wc-unix-word-count-command-on-windows – VonC Jul 27 '10 at 10:53
Hmm. I'm not entirely sure about this although the following will list all labels used for a given VOB (entered using ClearTool command line application).
lstype -kind lbtype -invob vob_path_and_name -short
for example with a View mapped to drive U: VOB "Some_VOB" would be:
lstype -kind lbtype -invob U:\Some_VOB -short

- 9,104
- 3
- 22
- 35
-
True, but need to filter based on the string passed. I can easily do it using the grep , but the limitation is that grep should not be used. Hence the only option left is to use the cleartool find command . Any idea would be appreciated. – Raj Jul 27 '10 at 09:59
-
I don't think that a wildcard can be used here, I was going to suggest a Perl script and then grep the results, but you say that you can't use grep. I'll have to think further. – ChrisBD Jul 27 '10 at 11:33