如何将 ClearCase 视图获取到 command.com 变量中
我正在编写一些 command.com 脚本来自动执行一些涉及 ClearCase 视图的任务。我可以使用 cleartool lsview viewname
来确定视图是否存在。如何将 lsview 子命令的输出获取到变量中,以便在视图不存在时脚本不会因cleartool 错误而终止?
I am writing some command.com scripts to automate some tasks involving ClearCase views. I can use cleartool lsview viewname
to determine if the view exists or not. How can I get the output from the lsview subcommand into a variable such that the script does not get terminated by a cleartool error when the view does not exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有足够新的 ClearCase (7.1.x),您还可以使用:(
将
替换为您的 ClearCase 注册表服务器名称)在 DOS 脚本中,您可以将其重定向到一个文件,然后将所述文件的内容影响到一个变量:
您可以使用
ERRORLEVEL
设置该 VAR 的条件(测试在cleartool之后完成)命令)。优点是,即使视图不存在,cleartool 命令也不会生成任何错误消息。
If you have a recent enough ClearCase (7.1.x), you can also use:
(replace
<registryServer>
by your ClearCase registry server name)In a DOS script, you would redirect that to a file, and then affect the content of said file to a variable:
You can put a condition on setting that VAR with
ERRORLEVEL
(test done just after the cleartool command).The advantage is that the cleartool command doesn't generate any error message, even if the view doesn't exist.