1

How can we print only the directories of branch latest in clearcase .

avarma
  • 39
  • 2
  • I see I have answered ClearCase questions for you before. Were any of those answers helpful? Are you aware of http://stackoverflow.com/help/accepted-answer? (or http://stackoverflow.com/help/why-vote) – VonC Jun 04 '14 at 09:09
  • You have posted an "answer" which was actually a question (http://stackoverflow.com/a/30589454). Why not read http://stackoverflow.com/tour to understand how Stack Overflow is working? – VonC Jun 02 '15 at 17:26

1 Answers1

0

You can use a cleartool find command in your view (which already selects the right version, like the LATEST from a branch):

cleartool find -type d -print

The '-type d' option will restrict the search for directory elements only.

More generally, in any view, you can try (see "general examples")

cleartool find . -type d -version version(.../yourBranch/LATEST) -print
# or
cleartool find . -type d -element version(.../yourBranch/LATEST) -print

The .../ notation allows you to search for a version in yourBranch, without having to specify parent branches (like /main/yourBranch or /main/anotherBranch/yourBranch)


If you want just the name, and or more details, use the fmt_ccase in a cleartool describe command:

Replace the -print with

# Windows syntax
-exec "cleartool descr -fmt \"%n\n\" \"%CLEARCASE_PN%\""

# Unix syntax
-exec 'cleartool descr -fmt "%n\n" "$CLEARCASE_PN"'
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250