4

I have a small tcl script which I am trying to run. I have changed the permissions to allow execution of the script (although it did require sudo access to do so?) checking the Ubuntu Software Centre, tcl is loaded. So how do I run it? Does it have to be run from command line? Shouldn't I be able to run it by double clicking on the script name?

obu-tim
  • 51
  • 1
  • 1
  • 4

2 Answers2

2

To run a TCL script from the command line, cd to the appropriate directory and then tclsh your_script.tcl

The effects of double clicking it depend upon the configuration of your desktop, and also what the script actually does - it may only send any output to the console, for which you'd need to have run it from the command line.

Carl H
  • 6,181
  • 6
  • 27
  • 41
2

The problem lies with you not configuring the Nautilus properly.

Refer to this post How do I run executable scripts in Nautilus? , change the Executable Text Files to Run executable text files when they are opened.

You can try the following helloworld script to test, the first line please change it to the path of your tclsh (you can find that by which tclsh:

#!/usr/bin/tclsh
package require Tk
button .b -text {Push Me} -command {tk_messageBox -message {hello, world}}
pack .b

enter image description here

The result will look something like this.

yuan3y
  • 196
  • 3