How to delete file elements by file extension in ClearCase?

前端 未结 2 1528
[愿得一人]
[愿得一人] 2021-01-15 01:28

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

2条回答
  •  天涯浪人
    2021-01-15 02:05

    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. 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

提交回复
热议问题