Clearcase: List labels matching a particular strin

2020-03-25 11:26发布

问题:

I would like to list the available labels matching a particular string applied in the view.

回答1:

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).



回答2:

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


标签: clearcase