–dep/th | –nr/ecurse | –d/irectory
–cvi/ew
–use/r login-name
–gro/up group-name
–typ/e { f | d | l } ...
–fol/low
–nxn/ame
–ele/ment query
–bra/nch query
–ver/sion query
–kin/d object-selector-kind ...
–ok command-invocation ...
The find command starts with a certain set of objects, selects a subset of the objects, and then performs an action on the subset. The selected objects can be elements, branches, versions, or VOB symbolic links. The action can be to list the objects or to execute a command on each object, either conditionally or unconditionally.
Typically, you start with all objects in a directory tree as seen in your view. You can also start with all objects in one or more VOBs, regardless of they are visible in a particular view.
Processing all VOB elements using –all or –avobs is an order of magnitude faster than going through its entire directory tree by specifying the VOB's root directory as a pname argument. With these options, the order in which elements are processed and/or reported is very different from directory-tree order.
If the CLEARCASE_AVOBS EV is set to a colon-separated list of VOB tags (in UNIX and Linux; in Windows, list items must be separated by semicolons), this set of VOBs is used instead.
The following options use the specified criteria to select subsets of objects.
If you did not specify –version, replaces each element and branch with the version that is currently in the view. (No substitution is performed on VOB symbolic links.)
If you did specify –version, further restricts the subset to versions that are currently in the view.
The options in this section select a subset of objects by using the VOB query language, which is described in the query_language reference page. You can use these options in any combination. They are always applied in this order, successively refining the set of selected objects: 1) –element; 2) –branch; 3) –version. The result of applying one or more of these options is a set of objects at the finest level of granularity: all versions if you used –version; all branches if you used –branch; all elements if you used –element. If you use none of these options, the set includes elements and VOB symbolic links. There is no way to use a query to select a set of VOB symbolic links.
Windows: If you invoke a command built in to the Windows shell (for example, cd, del, dir, or copy), you must invoke the shell with cmd /c. For example:
–exec "cmd /c copy %CLEARCASE_PN% %HOME%"
If a path within command-invocation contains spaces, you must enclose it in quotation marks. For example, in cleartool single-command mode (note the backslash used to escape the second quotation mark):
–exec "cmd /c copy %CLEARCASE_PN% \"c:\find results""
When using the –exec or –ok command invocation, do not use braces ({ }) to indicate a selected object or use a quoted or escaped semicolon to terminate the command. Instead, enter the entire command as a quoted string; use one or more of these environment variables to reference the selected object:
The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
cmd-context find . –type f –print
./Makefile@@
./hello.c@@
./hello.h@@
./msg.c@@
./util.c@@
This listing includes the extended naming symbol. The –nxname option suppresses this symbol.
cmd-context find –avobs –user smg –print
\work_vob\hw\util.c@@
\work_vob\hw\hello.c@@
\smg_tmp\bin@@\main\6\misc\main\3\text@@
\smg_tmp\bin@@\main\6\misc\main\3\Makefile@@
\smg_tmp\bin@@\main\6\misc\main\3\test.c@@...
cmd-context find . –version "lbtype(REL1)" –print
.@@/main/1
./Makefile@@/main/1
./hello.c@@/main/2
cmd-context find –all –element '{lbtype_sub(REL1) && lbtype_sub(REL2)}' ^
–version '{(lbtype(REL1) && ! lbtype(REL2)) || ^
(lbtype(REL2) && !lbtype(REL1))}' –print
\dev\testfile.txt@@\main\43
\dev\testfile.txt@@\main\68
\dev\util.c@@\main\50
\dev\util.c@@\main\58...
cmd-context find . –name "*.h" –element 'lbtype_sub(REL2) \
|| lbtype_sub(REL3)' –print ./hello.h@@
cmd-context find . –version 'QAed == "YES"' –print
.\Makefile@@\main\2
.\hello.c@@\main\4
.\hello.h@@\main\1
.\util.c@@\main\2
.\util.c@@\main\rel2_bugfix\1
cmd-context find . –nxname –element 'attr_sub(BugNum,==,189)' –print
./hello.c
cmd-context find . –element merge (\main\rel2_bugfix,\main) ^
–exec 'cmd /c copy %CLEARCASE_PN% %HOME%'
cmd-context find . –element "merge(/main/rel2_bugfix, /main)" \
–exec 'echo $CLEARCASE_PN >> /tmp/filelist'
% tar –cvf $HOME/rel2bugmerge.tar `cat /tmp/filelist`
% rm /tmp/filelist
cmd-context find . –version 'version(\main\LATEST) && ! lbtype(REL3)' ^
–exec 'cleartool mklabel –replace REL3 %CLEARCASE_XPN%'
cmd-context find . –ver 'lbtype(REL2)'\
–exec 'cleartool mkattr Testing \"Done\" $CLEARCASE_XPN'
cmd-context find . –branch brtype(experiment) ^
–ok 'cleartool rmbranch –force %CLEARCASE_XPN%'
cmd-context find . –all –element 'pool(my_cpool)' \
–exec 'cleartool chpool cdft $CLEARCASE_PN'
cmd-context find . –all –nvisible –exec 'cleartool lock –obsolete
%CLEARCASE_PN%'
cmd-context find . –version 'version(.../gopher/LATEST)' –print \
–exec 'cleartool describe –short –ahlink` Merge $CLEARCASE_XPN'
.@@/main/gopher/1
-> /vob1/proj/src@@/main/146
./base.h@@/main/gopher/1
-> /vob1/proj/src/base.h@@/main/38
./main.c@@/main/gopher/1
-> /vob1/proj/src/main.c@@/main/42
cmd-context find . –version "{brtype(main_dev) && created_since(30-Apr) &&
(! created_since(31-May)) && (! version(\main\main_dev\LATEST))}" -print