TIA.
Take care,
Tracy
tsw...@flash.net
When you run tclsh interactively and type commands, tcl looks them up
and executes them. If there's one it doesn't know about, like "echo",
it then tries to execute a program with that name. On a Sun, it
probably executes /usr/bin/echo or /bin/echo.
This works due to tcl's "unknown" handler. See the "unknown" man page
or the _Tcl and the Tk Toolkit_ book for more info.
Now, when you make a script file, note these things:
* Make the file executable: chmod +x <file> or chmod 755 <file> should
enough.
* Make the first line contain `#!' plus the path to the tclsh
executable, such as: ``#!/home/kelly/bin/tclsh''
* The first line has to be less than the operating system limit (which
varies) of about 30 characters. #!/home/kelly/local/src/eeep/fish/bin/tcslh
won't work!
* When you make a script, the "unknown" command *isn't* set up to
execute unknown commands as external programs. So "echo" won't
work!
Finally, in Tcl, the command you want is "puts", not "echo".
--k
>Path: hobbes.sco.COM!sgiblab!sgigate.sgi.com!swrinde!newsfeed.internetmci.com!in1.uu.net!boulder!emu.fsl.noaa.gov!kelly
>From: ke...@emu.fsl.noaa.gov (Sean Kelly)
>Newsgroups: comp.lang.tcl
>Date: 5 Feb 1996 20:56:35 GMT
>Organization: Forecast Systems Laboratory
>Lines: 30
>References: <4eun0f$q...@bounty.flash.net>
>NNTP-Posting-Host: emu.fsl.noaa.gov
>
>
>"echo" is not a tcl command.
but it is a tclX command - just about enough to make it worthwhile adding
that extension just for that capability ....
> ...
>
>Finally, in Tcl, the command you want is "puts", not "echo".
with the proviso that puts only takes a single data argument so you have
to quote or variablise things ..
tcl>puts a
a
tcl>puts a b
Error: bad file identifier "a"
tcl>puts stderr a
a
tcl>puts a
a
tcl>puts a b
Error: bad file identifier "a"
vtcl>puts a b c
Error: bad argument "c": should be "nonewline"
--
- hops
Everything disclaimed (including disclaimer)
------< ho...@sco.com>--------------------------------------
Mike Hopkirk ( hops ) | Whenever possible steal code.
SCO Inc | Tom Duff. Bell Labs