Command to find all view private files in the current directory recursively

前端 未结 6 1318
情歌与酒
情歌与酒 2020-11-28 11:49

What is the clearcase Command to find all view private files in the current directory recursively?

6条回答
  •  臣服心动
    2020-11-28 12:38

    In case it helps anyone else reading this question here is VonC's windows solution with a couple of minor changes to run as a windows script:

    @echo off
    setlocal
    for /F "usebackq delims=" %%A in (`cleartool ls  -rec ^| find /V "Rule:" ^| find /V "hijacked" ^| find /V "eclipsed" ^| find /V "-->"`) do @echo "%%A"
    

    Replace @echo with rmdir /S /Q and del /F to do the actual deletions as described here. So the final script is:

    @echo off
    setlocal
    for /F "usebackq delims=" %%A in (`cleartool ls  -rec ^| find /V "Rule:" ^| find /V "hijacked" ^| find /V "eclipsed" ^| find /V "-->"`) do rmdir /S /Q "%%A"
    for /F "usebackq delims=" %%A in (`cleartool ls  -rec ^| find /V "Rule:" ^| find /V "hijacked" ^| find /V "eclipsed" ^| find /V "-->"`) do del /F "%%A"
    

    If you save as a .bat file under the element of the view you are cleaning from, the script will clean up by deleting itself as well :-)

提交回复
热议问题