| hello world in tcl - radically simple |
|
| programming |
This article describes how to write and execute a "Hello World" tclsh script on Linux (Fedora).
1. the prerequisites
make sure you have installed the bash shell:
If it is not installed yet, you can install it with yum (you need to be root to do that):
2. write the code
now write the following lines into it: save the file and exit vi with ":wq + enter"
explanationThis tells the system to use the /bin/sh interpreter to execute the script. You can find out the full path of your sh interpreter by entering the following command:
from the man page: "The exec statement cause the shell to stop processing and instead to start up tclsh to reprocess the entire script. When tclsh starts up, it treats all three lines as comments, since the backslash at the end of the second line causes the third line to be treated as part of the comment on the second line."
{/chilicode}
prints the string "Hello World!"
3. make the script executable4. run the program
Comments (0)
Powered by !JoomlaComment 4.0 beta1
!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved." |

