小编Per*_*rcy的帖子

如何从tcl脚本运行csh脚本?

我试图从tcl脚本运行csh脚本.

下面的tcl脚本调用csh脚本

#!/usr/bin/tclsh


set scripts_path /scratch/TCL_scripts/scripts_adders

set synthesis /scratch/TCL_scripts/synthesis.csh


set files [glob -directory $scripts_path *]
split $files
set files [lsort $files]
set i 1

foreach script $files {

     puts "hello"
     # puts [pwd]
     exec /bin/csh -c $synthesis
     puts $i

}
Run Code Online (Sandbox Code Playgroud)

并且(开头)csh文件如下:

#!/bin/csh -f


echo abcdefgh
Run Code Online (Sandbox Code Playgroud)

当我只从我的unix终端执行csh文件时,它工作正常.当我调用我的Tcl脚本时,它运行并且确实写入"hello"并打印i,但csh文件未执行,因为"abcdefgh"从未出现在终端中.我也尝试过其他命令,我总是遇到同样的问题:当我从Tcl脚本运行它时,csh脚本永远不会被执行,即使它直接从终端运行它运行正常.

(我的Tcl脚本和csh脚本都是可执行的)

为了从我的Tcl脚本运行我的csh脚本,我该怎么办?

非常感谢你

unix csh tcl

4
推荐指数
1
解决办法
5124
查看次数

标签 统计

csh ×1

tcl ×1

unix ×1