TCL logging


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting TCL logging
# 1  
Old 10-20-2008
TCL logging

I'm using TCL to execute a shell script.

This shell script creates output that I want to capture into a log
file.


my script looks something like this:


set f [open "|/path/script/script.sh r]


puts stdout "\nFinshed running\n"
flush stdout


exit 0


When I run my tcl script, it executes the sh script and the shell
script sends output to the screen that says,


"Doing this"
"Doing that"
"Now I'm done."


I want to send this output to a logfile.


Can anyone help?
# 2  
Old 10-20-2008
Could you post the complete code?

I would probably do it like this:

Code:
set fi [open "|/path/script/script.sh r]
set fo [open "logfile" w]

set data [read $fi]

puts  $fo $data
flush $fo

PN
# 3  
Old 10-20-2008
This was perfect. The READ command was what I was looking for.

Thanks again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Syslog not logging successful logging while unlocking server's console

When unlocking a Linux server's console there's no event indicating successful logging Is there a way I can fix this ? I have the following in my rsyslog.conf auth.info /var/log/secure authpriv.info /var/log/secure (1 Reply)
Discussion started by: walterthered
1 Replies

2. Shell Programming and Scripting

Expect/tcl (not perl) logging troubles

My logs aren't correct. Im trying to log failure and successes, then use the resulting successes file "seed" to perform another function. Problem is that the log has only a single random entry. Thanks in advance for the help ! !#/usr/bin/expect set count 0 set bcount 0 set fcnb 923... (0 Replies)
Discussion started by: sumguy
0 Replies

3. Shell Programming and Scripting

Regexp in tcl

I need to change R3.1.5 as 03015 similarly R4.1.7 as 04017 i need a single command in tcl pls help ---------- Post updated at 05:19 PM ---------- Previous update was at 04:48 PM ---------- i had to do like this without using regexp set old_release "R3.1.5" ... (1 Reply)
Discussion started by: Syed Imran
1 Replies

4. 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

5. 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

6. Post Here to Contact Site Administrators and Moderators

Constant Logging In (After Logging Out)

Hi Everyone. First, I want to thank all of you for letting me participate in this great group. I am having a bit of a problem. After I get an email from a responder, I login to make my reply. In the mean time I get another response by email from another member, I go to reply to them and I... (6 Replies)
Discussion started by: Ccccc
6 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, 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 :confused: (2 Replies)
Discussion started by: Lorna
2 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