Problems with tcl "exec" command and "sh" in Cygwin.

Gancho Tenev
Sat Jan 31 09:27:00 GMT 2004


I am porting some scripts to cygwin.
In unix the scripts are is working fine.
but in cygwin I have a problem using the
tcl "exec" command.

I searched the FAQ, Docs and the mailing
list but I didn't find the answer.

I have the following scripts:

script: 1.tcl
# \
exec tclsh "$0" ${1+"$@"}

puts "result= [ exec 2.tcl ]"

script: 2.tcl
#!/bin/sh -e
# \
exec tclsh "$0" ${1+"$@"}

puts "Hello, World!"

* when I run on Unix:
result = Hello, World!

* when I run it in Cygwin.
couldn't execute "2.tcl": no such file or directory
    while executing
"exec 2.tcl "
    invoked from within
"puts "result= [ exec 2.tcl ]""
    (file "./1.tcl" line 5)

* To solve this instead of
    puts "result= [ exec 2.tcl ]"
I used:
    puts "result= [ exec sh 2.tcl ]"
and this was working fine.

* But 2 days ago we decided to reinstall Cygwin (latest)
and now it is hanging on "exec sh" infinitely.
It seems something has changed! We didn't do anything
special before and now while installing cygwin.

Any ideas and suggestions are greatly appreciated!
I tried to give concise description so please let me
know if I need to provide more info!

Best regards!

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list