I am using tcl tk to create a GUI application. I am referring to Ousterhout book. One of the sample code says:
In the examples so far you have typed Tcl commands interactively to tclsh or wish. You can also place commands into script files and invoke the script files just like shell scripts. To do this for the hello world example, place the following text in a file named hello:
#!/usr/local/bin/wish -f button .b -text "Hello, world!" -command exit pack .b
This script is the same as the one you typed earlier except for the first line. As far as wish is concerned this line is a comment but if you make the file executable (type “chmod 775 hello” to your shell, for example) you can then invoke the file directly by typing hello to your shell. When you do this the system will invoke wish, passing it the file as a script to interpret. Wish will display the same window shown in Figure 2.1 and wait for you to interact with it. In this case you will not be able to type commands interactively to wish; all you can do is click on the button. Note: This script will only work if wish is installed in /usr/local/bin. If wish has been installed somewhere else then you’ll need to change the first line to reflect its location on your system.
On my system I have tried this:
root@c3-redsuren-vm01:/# which wish
/usr/bin/wish
root@c3-redsuren-vm01:/# cd ~
root@c3-redsuren-vm01:~# cd Documents/scripts/
root@c3-redsuren-vm01:~/Documents/scripts# cat hello
#!/usr/bin/wish -f
button .b -text "Hello, world!" -command exit
pack .b
When i try to invoke the script it says -bash not found..
root@c3-redsuren-vm01:~/Documents/scripts# hello
-bash: hello: command not found