NorthGuard
NorthGuard

Reputation: 963

Can't call tcl commands in procedures that I can in console

I installed cygwin/curl on my machine and from tcl console or tclsh I can call the curl command however if I try to do it in a procedure I get the "invalid command name (name)" error.

e.g.

%curl -o google.html http://www.google.com

works, but

%proc a {} {curl -o google.html http://www.google.com}
%a

gives

invalid command name "curl"

I thought this was a namespace issue or something trivial but surprisingly I couldn't find too much useful information on it.

Upvotes: 2

Views: 389

Answers (1)

eemz
eemz

Reputation: 1211

In an interactive session, Tcl will try to "exec" anything you type that it doesn't understand. In a script it won't. Check out the "exec" and "catch" commands.

Upvotes: 4

Related Questions