Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Just started an hour ago, need help with setup on mac osx

Status
Not open for further replies.

Mithris

Programmer
Jun 27, 2008
1
US
Hello all.

I've just started learning the tk/tcl/wish combo this hour and would like a little help setting up my system.

Everything works as far as launching (wish/tclsh), but the only scripts I can get to work properly are those that launch wish into an X window.

I need some help with the scripts that pass text along to the terminal.

Here's the header I use to create a tcl script to successfully launch and display code in the X window:
Code:
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" ${1+"$@"}
# tcl script follows
button .b -text "Hello, world!" -command exit
pack .b

This works, but I can't figure out why anytime I try to do a terminal only script, I'll get something like this:
Code:
% ./EchoArgs.tcl 1 2 3
./EchoArgs.tcl: line 1: puts: command not found
./EchoArgs.tcl: line 2: puts: command not found
./EchoArgs.tcl: line 4: foreach: command not found
./EchoArgs.tcl: line 5: puts: command not found
./EchoArgs.tcl: line 6: incri: command not found
./EchoArgs.tcl: line 7: syntax error near unexpected token `}'
./EchoArgs.tcl: line 7: `}'
child process exited abnormally

Thanks.
 
I Think you have missed to tell your script to run TCL/TK
To run script under Unix/Linux/OSX without tell the program
so you could write

wish myScript

Or
Add the #! Line first in your script
#!/usr/bin/wish

And make the script runnable by
chmod +x myScript

Now it shuld work.

(Same soulution för PERL PYTHON RUBY and other script language)

mvh Anders
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top