ClearCase find and exec with %CLEARCASE_PN% in cmd always returns same element

巧了我就是萌 提交于 2019-12-11 05:52:29

问题


I executed the following command in cleartool.exe:

    cleartool> !
    Microsoft Windows XP [Version 5.1.2600]
    ...
    X:\dyn_view\vob\path>cleartool find . -type l -exec "cleartool describe
%CLEARCASE_PN%" -print

But the element output is always the same regarding exec, albeit being different in print. How to output the correct list in the exec part of the command?

Example output:

symbolic link ".\path\fileA.txt" -> ../../path/fileA.txt
  created ...
.\anypath\fileB.txt
symbolic link ".\path\fileA.txt" -> ../../path/fileA.txt
  created ...
.\anypath\fileC.txt

Where fileA is always the same (part of exec parameter), only fileB, fileC, etc., change (part of print parameter).


回答1:


Following the example listed in "Additional examples of the cleartool find command"

X:\dyn_view\vob\path>
cleartool find . -type l -exec "cleartool describe \"%CLEARCASE_PN%\""

So:

  • no -print at the end
  • '\"' around %CLEARCASE_PN% to take into account spaces in the path

Note that you can combine that with fmt_ccase for a refined display:

cleartool find . -type l -exec "cleartool describe -fmt \"%n %[slink_text]Tp\n\" \"%CLEARCASE_PN%\""

Example:

Y:\VOB_A>
cleartool find . -type l -exec "cleartool describe -fmt "%n%[slink_text]Tp\n\n\" \"%CLEARCASE_PN%\""
.\Directory\createsymlink.txt -->..\..\VOB_B\SymlinkFolder\createsymlink.txt

With:

%[slink_text]Tp

representing "Target of symbolic link, after link is traversed."



来源:https://stackoverflow.com/questions/11331048/clearcase-find-and-exec-with-clearcase-pn-in-cmd-always-returns-same-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!