1

So I want to display the versions of an activity: In the fmt_ccase I found the following format string:

%[versions]QCp

This returns me the quoted and comma separated version string. But I want then to be split by a newline. I tried the following:

cleartool lsact -fmt "%[versions]\np" my_act@\test_pvob

And:

cleartool lsact -fmt "%[versions]p\n" my_act@\test_pvob

Both did not work. Obviously I could achieve this using Powershell:

cleartool lsact -fmt "%[versions]p" my_act@\test_pvob).Split(" ")

But I want to now whether there is a ClearCase way to do this ?

andy meissner
  • 1,202
  • 5
  • 15

1 Answers1

1

The fmt_case documentation only references [p]Q, or [p]C as separators (quotes, comma), with newlines being '\n'.

If it does not work, you would have to so it by script, either Powershell as you mention, or using a bat script to process the output.

The \n newline syntax applies to each returned value, and in the case of %[version]p, there is only one returned value: the all list of versions (space-separated).
So no newline between each versions.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • What just wonders me is that it works for other commands e.g. `ct lscheckout -recurse -fmt "%[aliases]p\n" .\test_vob\` returns me the paths separated by new line – andy meissner Sep 04 '20 at 12:26
  • @andymeissner Right. I just tested `%[versions]pn`: can you test it? – VonC Sep 04 '20 at 12:28
  • cleartool lsact -fmt "%[versions]pn" evil_twin_act_1@\test_pvob – andy meissner Sep 04 '20 at 12:30
  • I don't know whether I'm doing something wrong or whether this is inconsistent design – andy meissner Sep 04 '20 at 12:31
  • @andymeissner No, I think the "`]p`": "`Property value: Displays the value of the property specified in square brackets. If multiple values are returned, they are separated by spaces.`" Means that there is no possible separator (like newlines) – VonC Sep 04 '20 at 12:33
  • @andymeissner I have edited the answer to explain the apparent design inconsistency. – VonC Sep 04 '20 at 12:35