Sponsored Content
Top Forums UNIX for Dummies Questions & Answers What is wrong with the the tcl script Post 302632783 by suvendra on Monday 30th of April 2012 07:57:44 PM
Old 04-30-2012
Hi All,

I am searching for two string in the .log file
The strings are
Code:
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
Code:
proc proc2 {arglist {count 1+} } {
    set header {}
    set i 0;
    foreach a $arglist  {

      if {[string compare {" "} $a]} {
         append header "\[\]\*" $a

       }
    }   
     set trimmed [string trimleft $header '\[\]\']
     set trimmed1 [string trimleft $trimmed *]
    return $trimmed1
   set matches [exec grep{trimmed1} abc.log]
   puts $matches
   }

proc2  "Active Flop-Maps 0     0     1    0    1     0" 1
proc2 "Ouput-Maps  0    0     1     1   0" 2

what is the correct script
Thanks in advance.
--Saraswati

Moderator's Comments:
Mod Comment Please use next time code tags for your code and data.
Do not post in FAQ please

Last edited by vbe; 05-02-2012 at 07:49 AM..
 

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. Shell Programming and Scripting

TCL script in PERL

Hi all, I am trying to run a tcl script in a perl script. Now my problem is when I run the tcl script from the perl script it runs very slowly but when I run the tcl script individually it is running at expected speed. What could be the problem?? Help please!!!! Thanks (0 Replies)
Discussion started by: mirock
0 Replies

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

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

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

9. UNIX for Advanced & Expert Users

Error in tcl script

hi all , i am trying to link a file with another file present in some other location in tcl shell. This is the way i am doing it if {} { file link /data/athena_dev/tanvi/tcl/tanvi.log "/data/athena_dev/tanvi/tanvi.tcl" } I am getting the error that /data/athena_dev/tanvi/tcl/ta nvi.log... (1 Reply)
Discussion started by: harjinder
1 Replies

10. Shell Programming and Scripting

TCL script help

Hi All , I am having a file as stated below File 1 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 =... (1 Reply)
Discussion started by: kshitij
1 Replies
gdal2tiles(1)						      General Commands Manual						     gdal2tiles(1)

NAME
gdal2tiles - gdal2tiles.py generates directory with TMS tiles, KMLs and simple web viewers SYNOPSIS
gdal2tiles.py [-title "Title"] [-publishurl http://yourserver/dir/] [-nogooglemaps] [-noopenlayers] [-nokml] [-googlemapskey KEY] [-forcekml] [-v] input_file [output_dir] DESCRIPTION
This utility generates a directory with small tiles and metadata, following OSGeo Tile Map Service Specification. Simple web pages with viewers based on Google Maps and OpenLayers are generated as well - so anybody can comfortably explore your maps on-line and you do not need to install or configure any special software (like mapserver) and the map displays very fast in the webbrowser. You only need to upload generated directory into a web server. GDAL2Tiles creates also necessary metadata for Google Earth (KML SuperOverlay), in case the supplied map uses EPSG:4326 projection. World files and embedded georeference is used during tile generation, but you can publish a picture without proper georeference too. -p PROFILE, --profile=PROFILE: Tile cutting profile (mercator,geodetic,raster) - default 'mercator' (Google Maps compatible). -r RESAMPLING, --resampling=RESAMPLING: Resampling method (average,near,bilinear,cubic,cubicspline,lanczos,antialias) - default 'average'. -s SRS, --s_srs=SRS: The spatial reference system used for the source input data. -z ZOOM, --zoom=ZOOM: Zoom levels to render (format:'2-5' or '10'). -e, --resume: Resume mode. Generate only missing files. -a NODATA, --srcnodata=NODATA: NODATA transparency value to assign to the input data. -v, --verbose Generate verbose output of tile generation. -h, --help Show help message and exit. --version Show program's version number and exit. KML (Google Earth) options: Options for generated Google Earth SuperOverlay metadata -k, --force-kml Generate KML for Google Earth - default for 'geodetic' profile and 'raster' in EPSG:4326. For a dataset with different projection use with caution! -n, --no-kml: Avoid automatic generation of KML files for EPSG:4326. -u URL, --url=URL: URL address where the generated tiles are going to be published. Web viewer options: Options for generated HTML viewers a la Google Maps -w WEBVIEWER, --webviewer=WEBVIEWER: Web viewer to generate (all,google,openlayers,none) - default 'all'. -t TITLE, --title=TITLE: Title of the map. -c COPYRIGHT, --copyright=COPYRIGHT: Copyright for the map. -g GOOGLEKEY, --googlekey=GOOGLEKEY: Google Maps API key from http://code.google.com/apis/maps/signup.html. -y YAHOOKEY, --yahookey=YAHOOKEY: Yahoo Application ID from http://developer.yahoo.com/wsregapp/. NOTE: gdal2tiles.py is a Python script that needs to be run against 'new generation' Python GDAL binding. AUTHORS
Klokan Petr Pridal klokan@klokan.cz as a Google SoC 2007 Project. GDAL
Tue Sep 18 2012 gdal2tiles(1)
All times are GMT -4. The time now is 02:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy