TCL, how to


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting TCL, how to
Prev   Next
# 1  
Old 10-07-2008
TCL, how to

Does any one know how to capture the output of command called from a TCL script?

I cannot figure this out. I've been working on it for 4 hours now Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with TCL script

I need to read a file, the file has a table in it. From the table I need to choose all the rows for which AVG 2 value is greater than 0.050 and write them on to a separate file. Please help me with the TCL script for this. Thanks in Advance (0 Replies)
Discussion started by: tonystark
0 Replies

2. Programming

Tcl script

Dear Users I'm struck by while the following tcl script. foreach l { set w($l) {} set fsum 0 foreach ftemp $f($l) { set fsum lappend w($l) $fsum } } It shows me error as "missing operand at _@_ in expression "0.10308400000000001 + _@_* 0.4 * 1" ... (0 Replies)
Discussion started by: bala06
0 Replies

3. Shell Programming and Scripting

help in tcl...

how can i make a list with the n last files and their details in tcl?.. thanks. (0 Replies)
Discussion started by: eee
0 Replies

4. UNIX for Advanced & Expert Users

Please help me in tcl/tk

i am new one to tcl/tk OTP-ARB:/home/ponmuthu/tcl=>/usr/bin/tclsh tclsh tclsh8.4 OTP-ARB:/home/ponmuthu/tcl=>/usr/bin/tclsh % wish Application initialization failed: no display name and no $DISPLAY environment variable when i give like that i am getting error Application... (0 Replies)
Discussion started by: ponmuthu
0 Replies

5. Shell Programming and Scripting

TCL in NS2

Hi all, I wrote a TCL script in NS2 which involves running multiple Voice and video sessions. Am not able to troubleshoot one error at all. Can anyone please help me please. I am ready to send the documents if possible. please please help me guys !! I am trying to solve the problem since... (0 Replies)
Discussion started by: mehera
0 Replies

6. Shell Programming and Scripting

read -e and Tcl

Hello, I'm trying to make Tcl work with GNU readline. Tried searching the forum but difficult to find this specific thing with "read" search query. Could someone help me to understand the following behavior? $ read -e asdfasdfasdfasddddf $ tclsh % exec read -e /usr/bin/read: read: bad... (0 Replies)
Discussion started by: pn8830
0 Replies

7. Shell Programming and Scripting

Need your help - tcl

Hello, Can someone explaine me the meaning of this program: #! /usr/bin/tclsh set mctal set a set b set c set d set e while {! line cell]} { } while {! line]} { } while {! line cell]} { } while {! line]} { } (0 Replies)
Discussion started by: jolecanard
0 Replies

8. Shell Programming and Scripting

tcl/expect

Can someone identify what is the problem here?. no children while executing "exp_wait -nowait -i -1" (procedure "logOptions" line 45) invoked from within "logOptions" (procedure "doExecute" line 98) invoked from within "doExecute" (procedure "main" line 32) ... (7 Replies)
Discussion started by: calsum
7 Replies

9. Shell Programming and Scripting

Help with Tcl...

Hello Tcl Experts, set i 0 while { $i < 10 } { puts "$i" incr i } I am trying to print the value of "i" at the same place. i.e. it should first print "1", then in next iteration print "2" over the location of "1" and so on.... (i.e. in every iteration, delete the previous number and... (2 Replies)
Discussion started by: sumitgarg
2 Replies

10. Shell Programming and Scripting

TK/TCL Help

can someone tell my why the puts is not reflecting the variable? CUT --> set fp while {-1 != } { button .a${line} -text "${line} " -width 20 -command { puts $line } pack .a${line} } (0 Replies)
Discussion started by: hpuxrox
0 Replies
Login or Register to Ask a Question
Standard Channels(3)					      Tcl Library Procedures					      Standard Channels(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_StandardChannels - How the Tcl library deals with the standard channels _________________________________________________________________ DESCRIPTION
This page explains the initialization and use of standard channels in the Tcl library. The term standard channels comes out of the Unix world and refers to the three channels automatically opened by the OS for each new appli- cation. They are stdin, stdout and stderr. The first is the standard input an application can read from, the other two refer to writable channels, one for regular output and the other for error messages. Tcl generalizes this concept in a cross-platform way and exposes standard channels to the script level. APPLICATION PROGRAMMING INTERFACES The public API procedures dealing directly with standard channels are Tcl_GetStdChannel and Tcl_SetStdChannel. Additional public APIs to consider are Tcl_RegisterChannel, Tcl_CreateChannel and Tcl_GetChannel. INITIALIZATION OF TCL STANDARD CHANNELS
Standard channels are initialized by the Tcl library in three cases: when explicitly requested, when implicitly required before returning channel information, or when implicitly required during registration of a new channel. These cases differ in how they handle unavailable platform- specific standard channels. (A channel is not "available" if it could not be successfully opened; for example, in a Tcl application run as a Windows NT service.) 1) A single standard channel is initialized when it is explicitly specified in a call to Tcl_SetStdChannel. The states of the other standard channels are unaffected. Missing platform-specific standard channels do not matter here. This approach is not available at the script level. 2) All uninitialized standard channels are initialized to platform-specific default values: (a) when open channels are listed with Tcl_GetChannelNames (or the file channels script command), or (b) when information about any standard channel is requested with a call to Tcl_GetStdChannel, or with a call to Tcl_GetChannel which specifies one of the standard names (stdin, stdout and stderr). In case of missing platform-specific standard channels, the Tcl standard channels are considered as initialized and then immediately closed. This means that the first three Tcl channels then opened by the application are designated as the Tcl standard channels. 3) All uninitialized standard channels are initialized to platform-specific default values when a user-requested channel is registered with Tcl_RegisterChannel. In case of unavailable platform-specific standard channels the channel whose creation caused the initialization of the Tcl standard chan- nels is made a normal channel. The next three Tcl channels opened by the application are designated as the Tcl standard channels. In other words, of the first four Tcl channels opened by the application the second to fourth are designated as the Tcl standard channels. RE-INITIALIZATION OF TCL STANDARD CHANNELS Once a Tcl standard channel is initialized through one of the methods above, closing this Tcl standard channel will cause the next call to Tcl_CreateChannel to make the new channel the new standard channel, too. If more than one Tcl standard channel was closed Tcl_CreateChannel will fill the empty slots in the order stdin, stdout and stderr. Tcl_CreateChannel will not try to reinitialize an empty slot if that slot was not initialized before. It is this behavior which enables an application to employ method 1 of initialization, i.e. to create and designate their own Tcl standard channels. SHELL-SPECIFIC DETAILS tclsh The Tcl shell (or rather the function Tcl_Main, which forms the core of the shell's implementation) uses method 2 to initialize the stan- dard channels. wish The windowing shell (or rather the function Tk_MainEx, which forms the core of the shell's implementation) uses method 1 to initialize the standard channels (See Tk_InitConsoleChannels) on non-Unix platforms. On Unix platforms, Tk_MainEx implicitly uses method 2 to initialize the standard channels. SEE ALSO
Tcl_CreateChannel(3), Tcl_RegisterChannel(3), Tcl_GetChannel(3), Tcl_GetStdChannel(3), Tcl_SetStdChannel(3), Tk_InitConsoleChannels(3), tclsh(1), wish(1), Tcl_Main(3), Tk_MainEx(3) KEYWORDS
standard channels Tcl 7.5 Standard Channels(3)