Sponsored Content
Full Discussion: TCL script help
Top Forums Shell Programming and Scripting TCL script help Post 303021660 by kshitij on Tuesday 14th of August 2018 08:35:53 AM
Old 08-14-2018
TCL script help

Hi All ,

I am having a file as stated below

File 1

Code:
chain = chan6   group = grp0  input = '/pad_pc10'  output = '/pad_pb7'  length = 9900
chain = chan2   group = grp0  input = '/pad_pa4'  output = '/pad_pb12'  length = 10000
chain = chan7   group = grp0  input = '/pad_pb2'  output = '/pad_pb15'  length = 9754
chain = chan3   group = grp0  input = '/pad_pa0'  output = '/pad_pb13'  length = 10000
chain = chan4   group = grp0  input = '/pad_pb3'  output = '/pad_pb10'  length = 10000
chain = chan0   group = grp0  input = '/pad_pc0'  output = '/pad_pb14'  length = 9917
chain = chan5   group = grp0  input = '/pad_pb9'  output = '/pad_pb11'  length = 9994
chain = chan1   group = grp0  input = '/pad_pc1'  output = '/pad_pa1'  length = 10000
chain = CWG   group = grp0  input = '/pad_pb0'  output = '/pad_pb4'  length = 97

I want to write a tcl script which will match the regexp output and then print only the output variables

OUTPUT file

Code:
'/pad_pc10'
'/pad_pa4'
'/pad_pb2'
'/pad_pa0'
'/pad_pb3'
'/pad_pc0'
'/pad_pb9'
'/pad_pc1'
'/pad_pb0'

I have tried to write below script but its not working
Pleas help me out


Code:
set fd [open "report" r]
while {[gets $fd line] >= 0} {
    if {[regexp "output" $line match match1]} {
        if {$match1 == 1} {
            puts $line
        }
    }
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed Script in TCL

Hi, I am trying to run the following in my tcl script--- set ul *//;s/*$//;/^$/d;s/^/"20080401 09:43:08.770798,/;s/$/"/;s/,/","/g} | \ /bin/awk -F, {{print $1","$2","$3","$4","$5}} | \ sed '1i\ REPORT.TIMESTAMP.s,REPORT.CUSTOMER.s,REPORT.CODE.s,REPORT.A_CODE.s,REPORT.DESCRIPTION.s' \ >... (2 Replies)
Discussion started by: MrG-San
2 Replies

2. Shell Programming and Scripting

TCL TK SCRIPT Help Please

Hi Seniors, Need a help from your end. I am new to scripting and still in the learning process of scripting. I have written a script on TCL TK. This is the script that i have written. if { $EssEntityType == "rss_user" && $EssAction == "Insert" } { puts $fp " Ess Action :$EssAction" ... (0 Replies)
Discussion started by: tech90210
0 Replies

3. Shell Programming and Scripting

expect TCL script

Hello, I write a TCL script for Expect/ Telnet. I want to send command to the telnet server. But I want to close after the command is sent. Anybody know which command can flush the expect so I can sure the command is sent to the telnet server??? EX: send "./command1\r" close... (0 Replies)
Discussion started by: linboco
0 Replies

4. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

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

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

7. UNIX for Dummies Questions & Answers

What is wrong with the the tcl script

Hi All, I am searching for two string in the .log file The strings are Active Flop-Maps "0 0 1 0 1" 1 and Ouput-Maps " 0 0 1 1 0" 2 It should search in the file ignoring white spaces .Tell me what is wrong with this script. The tcl script is as follows proc proc2 {arglist} { ... (2 Replies)
Discussion started by: suvendra
2 Replies

8. Shell Programming and Scripting

Split in tcl script

Hi All, I have a string re_em="NODE_NAME=ABCDEF;NODE_TYPE=ghijkl;CIRCLE=jkl;Serving_Circle=abcdefghthjk;DOMAIN_TYPE=1234;REGION=12345;ZONE=12334;SOURCE_TYPE=dhfkdkfjdjf" I want to split this string and convert it into array so that i can easily access any value like NODE_NAME or... (2 Replies)
Discussion started by: sujit_kashyap
2 Replies

9. Programming

Csh script and tcl

I have csh script and call tck command but it do nothing. can you help me? I only can see it echo #!/bin/csh -f set mypath = `pwd` echo $mypath if ($mypath =~ *PLL*) then echo "source ../PreBoot.qel" else if ($mypath !~ *PLL*) then echo "source ../hdfuse.qel" endif if i remove... (1 Reply)
Discussion started by: sabercats
1 Replies

10. Shell Programming and Scripting

Help using regexp in a TCL script ??

In a tcl script I need to find a way of reading a file, and looking for a phrase ("set myvariable") and putting the word following that into a variable. I've used a file open, and a while loop with gets to read each line from the file into a variable, and using regexp searched for the item. I'm... (1 Reply)
Discussion started by: Tonyb61
1 Replies
SSL_CTX_add_extra_chain_cert(3SSL)				      OpenSSL					SSL_CTX_add_extra_chain_cert(3SSL)

NAME
SSL_CTX_add_extra_chain_cert - add certificate to chain SYNOPSIS
#include <openssl/ssl.h> long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509) DESCRIPTION
SSL_CTX_add_extra_chain_cert() adds the certificate x509 to the certificate chain presented together with the certificate. Several certificates can be added one after the other. NOTES
When constructing the certificate chain, the chain will be formed from these certificates explicitly specified. If no chain is specified, the library will try to complete the chain from the available CA certificates in the trusted CA storage, see SSL_CTX_load_verify_locations(3). RETURN VALUES
SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the error stack to find out the reason for failure otherwise. SEE ALSO
ssl(3), SSL_CTX_use_certificate(3), SSL_CTX_set_client_cert_cb(3), SSL_CTX_load_verify_locations(3) 1.0.1e 2013-02-11 SSL_CTX_add_extra_chain_cert(3SSL)
All times are GMT -4. The time now is 08:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy