Clearcase find 命令与 Tcl 脚本和批处理文件结合使用:重定向不起作用
又是我;-)
我尝试从批处理文件启动cleartool find 命令。该批处理文件从 Tcl 脚本获取参数。
批处理文件:
SET VERARG="version(\main\LATEST) && !lbtype(%3)"
cleartool find . -version %VERARG% -print > Y:\x\Logs\%3.log
Tcl 脚本:
set v_cmd "y:\\x\\clearcase_find_change.cmd $v_drive $v_path $v_label \n"
set v_outp [exec cmd << $v_cmd]
当我从命令行启动批处理文件时,它可以工作并将命中写入日志文件,但是当我从 Tcl 启动它时,我在命令窗口中看到命中,但它只创建没有内容的日志文件。我已经使用一个非常简单的批处理文件对其进行了测试,该文件仅包含 echo 命令和重定向。这很有效,我也尝试过使用不同的驱动器,但没有成功。我还检查了批处理文件收到的参数,但对我来说一切看起来都很好。
简单的调用,有效:
Batch: echo %1 > Y:\x\%2.log
Tcl: set v_cmd "y:\\x\\simple_echo.cmd $v_lib $v_label \n"
it's me again ;-)
I try to start the cleartool find command from a batch file. That batch files gets his arguments from a Tcl script.
Batch File:
SET VERARG="version(\main\LATEST) && !lbtype(%3)"
cleartool find . -version %VERARG% -print > Y:\x\Logs\%3.log
Tcl Script:
set v_cmd "y:\\x\\clearcase_find_change.cmd $v_drive $v_path $v_label \n"
set v_outp [exec cmd << $v_cmd]
When I start the batch file from command line, it works and it wrotes the hits to the log-file, but when I start it from Tcl, I see the hits in the command window, but it only creates the log-files with no content. I tested it already with a very simple batch file, which only contents a echo command and a redirection. That worked, I've also tried to use different drives, but with no success. I checked also the received arguments of the batch-file, but everything looked fine to me.
Simple Call, which worked:
Batch: echo %1 > Y:\x\%2.log
Tcl: set v_cmd "y:\\x\\simple_echo.cmd $v_lib $v_label \n"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许缺少一个 cmd 指令来指定 DOS 会话应执行然后退出:
或:
或:(
以确保首先传递
/c
)请参阅 < a href="http://www.faqs.org/faqs/tcl-faq/tk/windows/" rel="nofollow">Tcl/Tk 常见问题解答:
Maybe it is missing a cmd directive to specify that the DOS session should execute and then quit:
or:
or:
(to make sure the
/c
is passed first)See Tcl/Tk FAQ: