开发者

TCL / TCLSH no such file or directory

开发者 https://www.devze.com 2023-03-07 18:51 出处:网络
I\'m trying to build a software called Slicer3 on Windows 7 which feat开发者_StackOverflow中文版ures a \"super build\".

I'm trying to build a software called Slicer3 on Windows 7 which feat开发者_StackOverflow中文版ures a "super build". It's a All-in-one TCL Script to checkout and build Slicer3.

I ran CYGWIN and navigated til the correct directory, then ran the script and got:

$ ./Slicer3-svn/Scripts/getbuildtest.tcl
couldn't read file "./Slicer3-svn/Scripts/getbuildtest.tcl": no such file or directory

Obviously I am sure that the file exists and I gave it 777 permission. I'm running cygwin as admin.

The beginning of the tcl file's content is:

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

So I tried commenting out line 3 and running directly

$ tclsh ./Slicer3-svn/Scripts/getbuildtest.tcl

but got the same error. Any idea?


I will try to help troubleshooting as much as I can:

Determine if you have tclsh installed and it is in the PATH:

$ tclsh

Determine if tclsh works for a simple script:

$ echo puts hello > hello.tcl; tclsh hello.tcl

Determine if the script exists and readable:

$ cat ./Slicer3-svn/Scripts/getbuildtest.tcl
$ cd ./Slicer3-svn/Scripts
$ cat getbuildtest.tcl

As far as line-ending (DOS CRLF vs. Unix LF):

$ cd ./Slicer3-svn/Scripts
$ sed 's/\r\n/\n/g' getbuildtest.tcl > getbuildtest_new.tcl
$ tclsh getbuildtest_new.tcl

This way, we can narrow down the problem, should any of the steps failed.


Description: TCLSH couldn't read file: no such file or directory. Possible reason: TCLSH under CYGWIN does not resolve windows PATH's properly, and cannot find the files. Workaround: move the script within the CYGWIN path.

just moving the script to a "simpler" path works for me. I'm not that sure about the reason, neither how to solve this misbehaviour.

0

精彩评论

暂无评论...
验证码 换一张
取 消