Re: "no such file or directory" when executing tcl file



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
.



Relevant Pages

  • Script to change time zone?
    ... windows xp sp2 machine? ... I'm going to need to change the timezone on ... a script out there that will do this for me to speed up the process. ...
    (microsoft.public.windowsxp.general)
  • Re: Script to change time zone?
    ... windows xp sp2 machine? ... I'm going to need to change the timezone on ... a script out there that will do this for me to speed up the process. ...
    (microsoft.public.windowsxp.general)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.misc)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.firewalls)
  • [NT] Flaw in Windows Script Engine Could Allow Code Execution
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The Windows Script Engine provides Windows operating systems with the ... blocked by Outlook Express 6.0 and Outlook 2002 in their default ...
    (Securiteam)