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

标签 find clearcase chmod

我正在尝试递归更改目录中的所有 .exe。

在发布之前我做了更多的挖掘,最终找到了我需要的东西。将发布我的答案,以防万一任何人都可以使用此信息。希望没关系,我是新来的。

ct find . -all -name *.bat -print -exec "cleartool protect -chmod +x -file ""%CLEARCASE_PN%""" 

最佳答案

当您考虑 man page of cleartool find ,以及 additional examples of cleartool find

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

  • 所以:
    ct find . -all -type f -name "*.bat" -exec "cleartool protect -chmod +x -file \"%CLEARCASE_PN%\""
    

    关于find - Clearcase 保护 -chmod +x 递归所有 *.exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8335455/

    相关文章:

    unix - 目录的递归列表

    .net - 根据对象的属性之一查找列表中对象的索引

    string - 查找包含多个字符串的文件

    linux - 使用 find 命令删除超过特定时间的多个扩展名

    file - 在批处理文件中不断删除感叹号

    php - 如何停止使用 chmod 或 .htaccess 编辑父目录的 PHP 文件?

    git - 灵活与静态分支(Git与Clearcase/Accurev)

    clearcase - 以编程方式确定给定的 VOB 是否安装在 ClearCase 中

    linux - 仅更改其他人的权限

    chmod - FTP权限755和777