Sponsored Content
Full Discussion: Parsing a control file loop
Top Forums Shell Programming and Scripting Parsing a control file loop Post 303017295 by MadeInGermany on Sunday 13th of May 2018 02:58:56 AM
Old 05-13-2018
The commands in quotes are troublesome.
Better have a tag that indicates where the (unquoted) command ends.
E.g. an empty line could do it.

Or perhaps you can give a filename?
And the given file stores the command(s)?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sending control c in the loop

I want to go through the list of items and run it. while running it, some of them will have either >there is no response # and then end it... so that it can go to next item OR >there is response # but in order to break out of it, u need to do Control c. How do you send control... (6 Replies)
Discussion started by: hankooknara
6 Replies

2. Shell Programming and Scripting

find command in while loop - how to get control when no files found?

I have the following statement in script: find ${LANDING_FILE_DIR}${BTIME_FILENAME_PATTERN2} -print | while read file; do ... done When there are no files located by the find comand it returns: "find: bad status-- /home/rnitcher/test/....." to the command line How do I get control in... (3 Replies)
Discussion started by: mavsman
3 Replies

3. Shell Programming and Scripting

for loop control

Hi, I have taken a piece of code from a book, which is working as per the specification. The code.... for entry in * do if then echo $entry fi done The sub-directories present in the current directory will be displayed while executing. ... (3 Replies)
Discussion started by: saravanakumar
3 Replies

4. Shell Programming and Scripting

Control Not Coming Out Of While Loop

I have an empty .gz file in archival directory. And I am redirecting to a dat file. My while loop is not getting ended. I need the solution. cnt=0 while read line do cnt=`expr $cnt + 1` echo "$ARCH_DIR/$line.gz" >> $DATA_DIR/$FILE_LIST_FILE_FEB FILE_NAMES=${FILE_NAMES}"... (2 Replies)
Discussion started by: vinodh1978
2 Replies

5. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

6. UNIX for Dummies Questions & Answers

For loop control with two variables in csh shell

Hi All How can i control for loop with two different variables in csh shell Regards Nikhil (1 Reply)
Discussion started by: Nikhilindurkar
1 Replies

7. Shell Programming and Scripting

Loop exit control

Hi I would like to exit the loop below on <Enter> even if it sleeps. Is it possible? while true do my_procedure; sleep 60 done Thanks (7 Replies)
Discussion started by: zam
7 Replies

8. Shell Programming and Scripting

Check and control params in parsing file

Hello, I would like to control and check the right parameters $1 must have 4 alphabetics digits among eora qora pora fora $2 must have 2 numerics digits 00 to 11 $3 must have 2 numerics digits 00 to 59 $4 must have 10 characters alpha numerics as 2013-02-26 For example : In case 5) if i... (1 Reply)
Discussion started by: amazigh42
1 Replies

9. Shell Programming and Scripting

Check and control params in parsing file

Hello, I would like to control and check the right parameters $1 must have 4 alphabetics digits among eora qora pora fora $2 must have 2 numerics digits 00 to 11 $3 must have 2 numerics digits 00 to 59 $4 must have 10 characters alpha numerics as 2013-02-26 For example : In case 5) if i... (15 Replies)
Discussion started by: amazigh42
15 Replies

10. Shell Programming and Scripting

Parsing log file and print latest number in loop

Hello All, I have an awk script which parses my log file and prints number grepping from a specific line/pattern, now i have to come with a shell script to continue reading the log untill the job is completed, which i would know while reading session log untill process encounters a final... (1 Reply)
Discussion started by: Ariean
1 Replies
uevent(3tcl)							    User events 						      uevent(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
uevent - User events SYNOPSIS
package require Tcl 8.4 package require uevent ?0.2? package require logger ::uevent::bind tag event command command tag event details ::uevent::unbind token ::uevent::generate tag event ?details? ::uevent::list ::uevent::list tag ::uevent::list tag event _________________________________________________________________ DESCRIPTION
This package provides a general facility for the handling of user events. Allows the binding of arbitrary commands to arbitrary events on arbitrary tags, removal of bindings, and event generation. The main difference to the event system built into the Tcl/Tk core is that the latter can generate only virtual events, and only for wid- gets. It is not possible to use the builtin facilities to bind to events on arbitrary (pseudo-)objects, nor is it able to generate events for such. Here we can, by assuming that each object in question is represented by its own tag. Which is possible as we allow arbitrary tags. More differences: [1] The package uses only a two-level hierarchy, tags and events, to handle everything, whereas the Tcl/Tk system uses three levels, i.e. objects, tags, and events, with a n:m relationship between objects and tags. [2] This package triggers all bound commands for a tag/event combination, and they are independent of each other. A bound command cannot force the event processing core to abort the processing of command coming after it. API
The package exports three commands, as specified below: ::uevent::bind tag event command Using this command registers the command prefix to be triggered when the event occurs for the tag. The result of the command is an opaque token representing the binding. Note that if the same combination of <tag,event,command> is used multiple times the same token is returned by every call. The signature of the command prefix is command tag event details where details contains the argument(s) of the event. Its contents are event specific and have to be agreed upon between actual event gener- ator and consumer. This package simply transfers the information and does not perform any processing beyond that. ::uevent::unbind token This command releases the event binding represented by the token. The token has to be the result of a call to ::uevent::bind. The result of the command is the empty string. ::uevent::generate tag event ?details? This command generates an event for the tag, triggering all commands bound to that combination. The details argument is simply passed unchanged to all event handlers. It is the responsibility of the code generating and consuming the event to have an agreement about the format and contents of the information carried therein. The result of the command is the empty string. Note that all bound commands are triggered, independently of each other. The event handlers cannot assume a specific order. They are also not called synchronously with the invokation of this command, but simply put into the event queue for processing when the sys- tem returns to the event loop. Generating an event for an unknown tag, or for a <tag,event> combination which has no commands bound to it is allowed, such calls will be ignored. ::uevent::list In this form the command returns a list containing the names of all tags which have events with commands bound to them. ::uevent::list tag In this format the command returns a list containing the names of all events for the tag with commands bound to them. Specifying an unknown tag, i.e. a tag without event and commands, will cause the command to throw an error. ::uevent::list tag event In this format the command returns a list containing all commands bound to the event for the tag. Specifying an unknown tag or unknown event, will cause the command to throw an error. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category uevent of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
hook(3tcl) KEYWORDS
bind, event, generate event, hook, unbind CATEGORY
Programming tools COPYRIGHT
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net> uev 0.2 uevent(3tcl)
All times are GMT -4. The time now is 01:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy