Many times people want to do things like run a program feeding it information, or doing some setup, then running a command and doing something with its output, or writing a Tk wrapper for a text only command. ---- Here's an example of wrapping the '''bc''' arbitrary precision arithmetic language calculator in Tcl. This might provide one with longer precision math without implementing one of the extensions discussed in [Arbitrary Precision Math Procedures]. #! /usr/tcl84/bin/tclsh # Program: bcfe # Date: Jan 27, 2003 # Version: 1.1 set fe [open "|/bin/bc -l" "r+"] fconfigure $fe -buffering none puts "Enter expression:" set ex 1 puts -nonewline "bc $ex> " flush stdout while { [gets stdin input] >= 0 } { if { $input == "quit" } { break } puts $fe "$input" flush $fe incr ex gets $fe newans puts "Answer is: $newans" puts -nonewline "bc $ex> " flush stdout } ---- Derk Gwen succinctly answers the oh-so-frequently-asked question about how to keep Tk "live" while managing a sub-process in a clt posting [http://groups.google.com/groups?q=append+output+rs+rc+readable+group:comp.lang.tcl*&hl=en&lr=&ie=UTF-8&selm=v37uvs8rim6i0f%40corp.supernews.com&rnum=1]. ---- See [[add in reference to Alex's page]] for lots of ways to communicate between applications. ---- [[ [CL] intends to link in lots of references to related topics: Tcl and other processes, Tcl and other languages, the idea of wrapping, ...]] ---- [Category Application]