如何在ClearCase中通过文件扩展名删除文件元素? [英] How to delete file elements by file extension in ClearCase?

查看:112
本文介绍了如何在ClearCase中通过文件扩展名删除文件元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大量的 xxx.cmd 文件位于多个文件夹中(例如 child1 child2 child3 等),它们有一个父文件夹 parent

I have tons of xxx.cmd files that sit in multiple folders (e.g. child1, child2, child3, etc), they have a parent folder parent

是否有一个我可以在 parent 文件夹中执行的cleartool命令,该文件夹删除所有。所有子文件夹中的cmd 文件?

Is there a cleartool command that I can executes on the parentfolder that deletes all the .cmd files in all children folders?

推荐答案

我今天有同样的需求,但不是很高兴由于需要制作本地副本,因此建议使用 clearfsimport 。这是我在bash环境(对我而言,在Windows下的msys)中所做的事情:

I had the same need today and was not very happy with the proposition of using clearfsimport because of the need to make a local copy. This what I have done in a bash environment (msys under windows for me):


  1. 列出所有要使用查找:

    查找父级-name * .cmd | tee to_remove_list.txt

  2. 提取文件夹列表:

    排序to_remove_list.txt | xargs -i目录名{} | uniq | tee to_checkout.txt

  3. 签出所有这些文件夹:

    cat to_checkout.txt | xargs -i cleartool co -nc {}

  4. 删除文件:

    cat to_remove_list.txt | xargs -i cleartool rm {}

  5. 签入所有文件夹:

    cat to_checkout.txt | xargs -i cleartool ci -nc {}

  6. (可选)清理文件夹和文件列表:

    rm to_remove_list.txt to_checkout.txt

  1. List all files to delete using find:
    find parent -name "*.cmd" | tee to_remove_list.txt
  2. Extract a list of folders:
    sort to_remove_list.txt | xargs -i dirname {} | uniq | tee to_checkout.txt
  3. Check-out all those folders:
    cat to_checkout.txt | xargs -i cleartool co -nc {}
  4. Remove the files:
    cat to_remove_list.txt | xargs -i cleartool rm {}
  5. Check-in all folders:
    cat to_checkout.txt | xargs -i cleartool ci -nc {}
  6. (Optional) clean-up the folders and file lists:
    rm to_remove_list.txt to_checkout.txt

这篇关于如何在ClearCase中通过文件扩展名删除文件元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆