0
votes

I have a c-shell script that hypothetically does a ton of things and gives little messages along the way.

Example (test.csh):

#!/bin/csh
echo "hello world."
sleep 10
echo "hello again."
sleep 10

I am calling the script from tclsh.

exec /bin/csh test.csh

All the output is held back until end of the script. That is not desired. Desired outcome is to get output from the script as it happens. How would I modify the TCL call to achieve the desired outcome?

Thanks.

1
Have you checked out previous posts? See, e.g., stackoverflow.com/questions/13341427/…mrcalvin

1 Answers

1
votes

One approach could be as follows:

exec >@stdout 2>@stderr /bin/csh test.csh

Check out the corresponding sections of the exec manpage, e.g.: >@

It turns out that your question has been raised before: How can I run a csh script from a tcl script?