-1

We have a script that labels files recursively. Here is the command that executes the label command.

cleartool ls -recurse -vob_only -visible -short | \
    xargs cleartool mklabel -replace -follow VPCEUM_9.0.0.99 > label.txt 2>&1

When is encounter files with spaces the name such as /directory/d1/my file is here.doc, the command errors off.

How do I get ClearCase/unix to accept the space?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
user4067896
  • 145
  • 1
  • 10

1 Answers1

0

You have tow approaches with cleartool mklabel:

  • you can use mklabel directly, with the -recurse option.
    That will label all the files (with or without space) for you. But that can label files that are not in your current view.

     cleartool mklabel -recurse -replace -follow VPCEUM_9.0.0.99
    
  • Or, as I mentioned in "Cleartool: How to apply label to files which are in my current view only?", you use cleartool find:

    # Windows syntax
    cleartool find . -cview -exec "cleartool mklabel -replace TEST_LABEL \"%CLEARCASE_XPN%\""
    
    # Unix syntax
    cleartool find . -cview -exec 'cleartool mklabel -replace TEST_LABEL "$CLEARCASE_XPN"'
    

The "$CLEARCASE_XPN" part allows you to label files with spaces.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I’m trying to run the cleartool find and mklabel commands on windows using Perl but the spaces problems is not solved, Any idea what should be the syntax ? system(" cleartool find V:\\$VIEW\\$VOB -cview -version {!lbtype($LABEL)} -exec \"cleartool mklabel -replace $LABEL %CLEARCASE_XPN%\" "); – Epligam Oct 07 '15 at 12:40
  • @Elad that is a good question, that you could ask separately. I'll keep looking in the meantime. – VonC Oct 07 '15 at 13:42