如何在Perl中执行cleartool命令 [英] How to execute cleartool command within perl

查看:74
本文介绍了如何在Perl中执行cleartool命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,如果它天真。我想编写一个简单的PERL脚本,该脚本将接受两个参数(此处提交标签),这些参数被用作cleartool命令的输入并为我提供合适的输出。
我的代码:

Sorry if its to naive. I am wanting to write a simple PERL script that will accept two arguments(Here Commit Labels) which are taken as inputs to cleartool command and provides me with a suitable output. My Code:

#!/usr/bin/perl
$file1 = system('cleartool find . -version "lbtype($ARGV[0])" -print > filename1');
$file2 = system('cleartool find . -version "lbtype($ARGV[1])" -print > filename2');
$file3 = system('diff filename1 filename2 > changeset');
print $ARGV[0];
print $ARGV[1];
print $file3;
close filename1;
close filename2;
close changeset

现在输出为3个空文件:filename1,filename2和changeset。
但是我需要在两个已提交标签之间提交的文件。

The output now is 3 empty files: filename1,filename2 and changeset. But i need the files committed between the two committed labels.

有人可以向我阐明我要去哪里的地方!!

Could anyone shed light as to where i am going wrong!!

预先感谢。

推荐答案

尝试一下:

$file1 = system("cleartool find . -version 'lbtype($ARGV[0])' -print > filename1");

而不是

$file1 = system('cleartool find . -version "lbtype($ARGV[0])" -print > filename1');

这篇关于如何在Perl中执行cleartool命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆