4

I am trying to recursively change all .exe in a directory.

I did a bit more digging before posting and ended up finding what I needed. Will post with my answer just on case anyone can used this information. Hope that is alright I am new here.

ct find . -all -name *.bat -print -exec "cleartool protect -chmod +x -file ""%CLEARCASE_PN%""" 
Artjom B.
  • 61,146
  • 24
  • 125
  • 222
emptyshell
  • 103
  • 1
  • 13
  • It seems a little odd to be keeping executables checked in to ClearCase; they are normally derived files and do not need to be version controlled. (The source that is used to create them should be version controlled, of course, but that's a different matter - and the source does not need to be executable, in general). – Jonathan Leffler Dec 01 '11 at 05:46
  • I work at a Medical Device company. We keep just about everything. – emptyshell Dec 01 '11 at 18:45

1 Answers1

5

When you consider the man page of cleartool find, and the additional examples of cleartool find

  • -all generally for quite lengthy search, especially for large vob with a long history, so you want to add selection criteria to reduce the time, like '-type f' to only consider files.
  • '-print' isn't necessary, except if you want the list of all .exe changed, but the simple fact to print each element can slow down the operation considerably.
  • the additional quotations are needed to pick filenames that contain spaces, but you can use an escape notation, more readable: \"
  • ct doesn't exist unless you define the alias for cleartool (in windows: doskey ct=cleartool $*)

So:

ct find . -all -type f -name "*.bat" -exec "cleartool protect -chmod +x -file \"%CLEARCASE_PN%\""
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I do like your solution better. I tried to give it an additional +1 but do not have the rep to do so. Very detailed answer, thank you. – emptyshell Dec 01 '11 at 18:48