Clearcase 如何用管道描述推荐基线
我试图找到复合基线中关联的所有组件基线 我可以通过以下方法实现它Clearcase 如何用管道描述推荐基线,clearcase,cleartool,clearcase-ucm,Clearcase,Cleartool,Clearcase Ucm,我试图找到复合基线中关联的所有组件基线 我可以通过以下方法实现它 cleartool desc -fmt %[rec_bls]CXp stream:My_Integration@\My_PVOB (I would save the receommended baselines in some variable using powershell and replace it in next command) cleartool describe -l baseline:"$Baseline"
cleartool desc -fmt %[rec_bls]CXp stream:My_Integration@\My_PVOB
(I would save the receommended baselines in some variable using powershell and replace it in next command)
cleartool describe -l baseline:"$Baseline"@\My_PVOB
是否可以合并这两个命令,以便我可以描述所有推荐的基线
在上面的方法中,我被迫使用一些脚本来保存基线,然后在Cleartool命令中使用它。如果它可以在cleartool本身中组合,它将是好的和方便的。我没有找到一种方法在复合基线和它的成员基线之间管道化这两个
描述
我的解决方案(并不令人满意)是,在bash中(通过msyswwin在Windows上提供,并使用以下工具):
我使用我需要的任何fmt
(这里只是与成员基线关联的组件的名称及其名称)
然后我执行每个输出行,以便在“afile
”中获得最终结果
您的PowerShell脚本方法当然更好
事实上,以下PowerShell方法得到了证实:
$Baselinefile="C:\Baseline.txt"
$project="MyComponents@\My_PVOB"
$pvob="@\My_PVOB"
# Find the list of Recommended baseline for the project
$Baselines=(cleartool lsproject -fmt "%[rec_bls]p" $project).split()
#Foreach baseline get the baseline and Component Name
foreach ($Bline in $Baselines) {
cleartool describe -l baseline:"$Bline"$pvob | Select-string -pattern "@\\My_PVOB)"| Out-File $BaselineFile -append
}
好啊我正在使用以下powershell解决此问题。“$Baselinefile=“C:\Baseline.txt”$project=“MyComponents@\My_PVOB”$PVOB=“@\My_PVOB”#查找项目的建议基线列表$Baselines=(cleartool lsproject-fmt”%[rec_bls]p“$project)。split()#对于每个基线,获取每个($Baselines中的Bline)的基线和组件名称{cleartool description-l Baseline:$Bline“$pvob |选择字符串模式”@\\My_pvob)| Out File$BaselineFile-append}希望它能帮助其他人future@Samselvaprabu:非常有趣的反馈,谢谢。我在回答中加入了您的脚本以提高可视性。@VonC:在您的命令管道中…| grep“b)”|…这是否正确?意义何在?我怀疑@jayan(3年后)我在寻找包含“b”的行,可能是因为其中包含“vob”(我现在无法测试)
$Baselinefile="C:\Baseline.txt"
$project="MyComponents@\My_PVOB"
$pvob="@\My_PVOB"
# Find the list of Recommended baseline for the project
$Baselines=(cleartool lsproject -fmt "%[rec_bls]p" $project).split()
#Foreach baseline get the baseline and Component Name
foreach ($Bline in $Baselines) {
cleartool describe -l baseline:"$Bline"$pvob | Select-string -pattern "@\\My_PVOB)"| Out-File $BaselineFile -append
}