且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ClearCase仅删除查看私有文件

更新时间:2023-12-05 19:03:52

您是的,这两个部分都不起作用:

You are right, none of those two soution would work:

 cleartool ls -rec | grep -v "Rule:" | grep -v "eclipsed" | grep -v "-->"  | xargs rm -v

cleartool lsprivate | | grep -v eclipsed | xargs rm -v

    cleartool lsprivate | grep -v "eclipsed" | xargs rm -v

来源:我在 命令以递归方式查找当前目录中的所有查看私有文件

An lsprivate 像其他私有文件一样单独列出被遮盖的文件:

An lsprivate alone lists eclipsed file like any other private file:

M:\yourDynView\yourVob\aDir\>ct lsprivate

M:\yourDynView\yourVob\aDir\aFile.vsd
M:\yourDynView\yourVob\aDir\aPrivateFile

但是, lsprivate -l 列出蚀过的文件两次:

But, an lsprivate -l list eclipsed file twice:

M:\yourDynView\YourVob>ct lsprivate -long

view private object    M:\yourDynView\yourVob\aDir\aFile.vsd
file element           M:\yourDynView\yourVob\aDir\aFile.vsd@@ [eclipsed]
view private object    M:\yourDynView\yourVob\aDir\aPrivateFile

So您需要三遍


  • 一个来生成 cleartool lsprivate -l

  • 一个删除行上方的行,其中包含黯淡的

  • 一个可以读取该文件并删除该文件中列出的其余私人文件

  • one to generate that cleartool lsprivate -l
  • one to remove any line above a line which contains eclipsed
  • one to read that file and delete the remaining private files listed in that file

第二步可以是(在此线程

gawk "{if ((NR!=1)&&($0!~/eclipsed/)) {if ($lastlin!~/eclipsed/) {print astlin};lastlin=$0} } END{print lastlin} " s

带有' s '的文件包含 cleartool lsprivate -l 的结果。

With 's' the file containing the result of a cleartool lsprivate -l.