I am trying to run a csh script from a tcl script.
The tcl script below calls a csh script
#!/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
}
And the (begining of the) csh file is below:
#!/bin/csh -f
echo abcdefgh
When I only execute the csh file from my unix terminal, it works fine. When I call my Tcl script, it runs and indeed writes "hello" and prints i, but the csh file is not executed because "abcdefgh" never appears in the terminal. I have also tried other commands, and I always have the same problem: the csh script is never executed when I run it from a Tcl script, even though it runs fine when I run it directly from the terminal.
(Both my Tcl script ans csh script are executable)
What must I do in order to run my csh script from my Tcl script ?
Thank you very much