Re: "no such file or directory" when executing tcl file
- From: "Patrick H." <patrickh@xxxxxxxxx>
- Date: Mon, 12 Jan 2009 16:25:10 -0800 (PST)
On Jan 12, 6:18 pm, Mark Janssen <mpc.jans...@xxxxxxxxx> wrote:
On Jan 13, 12:43 am, "Patrick H." <patri...@xxxxxxxxx> wrote:
Hi, new to TCL and hitting a road bump right out the gate. I just
installed ActiveTcl 8.5 on my Windows XP SP2 machine. I made the
following script and saved it as test.tcl:
#!/usr/local/bin/tclsh
puts stdout {Hello, Patrick!}
When in the TCL command prompt, I type test.tcl and it gives me the
error "couldn't execute ".\test.tcl": no such file or directory". I am
in the correct directory so I'm pretty lost as to why it is saying
this. Here are my exact steps:
<open command prompt>
H:\workspaces\tcl>tclsh85
% dir
Volume in drive H is Data
Volume Serial Number is 828C-6076
Directory of H:\workspaces\tcl
01/12/2009 05:23 PM <DIR> .
01/12/2009 05:23 PM <DIR> ..
01/12/2009 05:37 PM 31 test.tcl
1 File(s) 31 bytes
2 Dir(s) 41,173,749,760 bytes free
% test.tcl
couldn't execute ".\test.tcl": no such file or directory
If someone could help fill in the blanks here, I'd appreciate it.
Apparently I'm overlooking something obvious. Thanks,
Patrick
To load a tcl script in tclsh use [source] so use
% source test.tcl
another option is to do:
tclsh test.tcl
The #! line will not do anything on windows, it's a unix-ism.
Mark
Thanks for the fast reply mark, I appreciate it. That info is exactly
what I was looking for.
I've been using Perl for a bit, and that trained me to always include
the #! line in case the script is ever run on a unix machine - now I
do it out of habit.
Thanks again,
Patrick
.
- References:
- "no such file or directory" when executing tcl file
- From: Patrick H.
- Re: "no such file or directory" when executing tcl file
- From: Mark Janssen
- "no such file or directory" when executing tcl file
- Prev by Date: Re: "no such file or directory" when executing tcl file
- Next by Date: Re: Segmentation fault on running wish(Tk)
- Previous by thread: Re: "no such file or directory" when executing tcl file
- Index(es):
Relevant Pages
|