Clearcase保护-chmod + x递归所有*.exe

emp*_*ell 4 clearcase find chmod

我试图递归更改目录中的所有.exe.

在发布之前我做了一些挖掘并最终找到了我需要的东西.如果有人可以使用这些信息,我会回答我的回答.希望没关系,我是新来的.

ct find . -all -name *.bat -print -exec "cleartool protect -chmod +x -file ""%CLEARCASE_PN%""" 
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 5

当您考虑手册页cleartool find其他示例时cleartool find

  • -all通常用于相当长的搜索,特别是对于具有悠久历史的大型vob,因此您希望添加选择标准以减少时间,例如" -type f仅考虑文件".
  • ' -print'是没有必要的,除非你想要更改所有.exe的列表,但打印每个元素的简单事实可能会大大减慢操作.
  • 选择包含空格的文件名需要额外的引用,但您可以使用转义表示法,更具可读性: \"
  • 除非你为cleartool定义别名(在windows中doskey ct=cleartool $*),否则ct不存在

所以:

ct find . -all -type f -name "*.bat" -exec "cleartool protect -chmod +x -file \"%CLEARCASE_PN%\""
Run Code Online (Sandbox Code Playgroud)