9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I have many files but with only 2 names , I want to load the data of that file into database through sqlldr with single control file. how can i do that ?????
Example:
switch_file
switch_file
billing_file
billing_file
now these files should be loaded into same database but different... (1 Reply)
Discussion started by: niti_sharma
1 Replies
2. Shell Programming and Scripting
Hi,
I am facing issues with the below:
I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,).
Now i want to read this command from file and execute it.
So my code below is :
Contents in the lookup.lkp file is :
c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Discussion started by: vital_parsley
7 Replies
3. Shell Programming and Scripting
I've a list of files which got processed in Target table A and stored in a control file(list of control files).
I've want to trigger another process (later) based on this list of files and load into Target table B and continue running this process until this file list is exhuasted.
How do I come... (1 Reply)
Discussion started by: manojg9
1 Replies
4. Shell Programming and Scripting
I have to write a program to read data from files and then format into another file. However, I face a strange problem related to control character that I can't understand and solve.
The source file is compose of many lines with such format:
T_NAME|P_NAME|P_CODE|DOCUMENT_PATH|REG_DATE
... (3 Replies)
Discussion started by: hk6279
3 Replies
5. Shell Programming and Scripting
I have a UNIDATA file with this line
EIR.ENTRYýIND.RATE.CALCýBUILD.EIR.ITEMýIND.RATES.WEBSERVICEýIND.GRP.COMPLIANCEýIND.RATE.AUDIT
If I edit my unidata file with Notepad++ or something and replace ý with ~ then this works
IFS="~"
while read DATA
do
My question is what do I need... (14 Replies)
Discussion started by: hpodhrad
14 Replies
6. UNIX for Dummies Questions & Answers
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Discussion started by: victor.s
3 Replies
7. Shell Programming and Scripting
if TERM has the value vt220, where will you expect to find its control file (0 Replies)
Discussion started by: thelakbe
0 Replies
8. Programming
# include <stdio.h>
# include <fcntl.h>
# include <stdlib.h>
# include <sys/stat.h>
int main(int argc, char *argv)
{
int fRead, fPadded, padVal;
int btRead;
int BUFFSIZE = 512;
char buff;
if (argc != 4)
{
printf ("Please provide all of the... (3 Replies)
Discussion started by: naranja18she
3 Replies
9. Shell Programming and Scripting
Hi All,
I am very new to Shell scripting...
I got a requirement.
I will have few text files(data files) in a particular directory. they will be with .txt extension. With same name, but with a different extension control files also will be there. For example, Sample_20081001.txt is the data... (4 Replies)
Discussion started by: purna.cherukuri
4 Replies
control(n) Tcl Control Flow Commands control(n)
__________________________________________________________________________________________________________________________________________________
NAME
control - Procedures for control flow structures.
SYNOPSIS
package require Tcl 8.2
package require control ?0.1.3?
control::control command option ?arg arg ...?
control::assert expr ?arg arg ...?
control::do body ?option test?
control::no-op ?arg arg ...?
_________________________________________________________________
DESCRIPTION
The control package provides a variety of commands that provide additional flow of control structures beyond the built-in ones provided by
Tcl. These are commands that in many programming languages might be considered keywords, or a part of the language itself. In Tcl, con-
trol flow structures are just commands like everything else.
COMMANDS
control::control command option ?arg arg ...?
The control command is used as a configuration command for customizing the other public commands of the control package. The com-
mand argument names the command to be customized. The set of valid option and subsequent arguments are determined by the command
being customized, and are documented with the command.
control::assert expr ?arg arg ...?
When disabled, the assert command behaves exactly like the no-op command.
When enabled, the assert command evaluates expr as an expression (in the same way that expr evaluates its argument). If evaluation
reveals that expr is not a valid boolean expression (according to [string is boolean -strict]), an error is raised. If expr evalu-
ates to a true boolean value (as recognized by if), then assert returns an empty string. Otherwise, the remaining arguments to
assert are used to construct a message string. If there are no arguments, the message string is "assertion failed: $expr". If
there are arguments, they are joined by join to form the message string. The message string is then appended as an argument to a
callback command, and the completed callback command is evaluated in the global namespace.
The assert command can be customized by the control command in two ways:
[control::control assert enabled ?boolean?] queries or sets whether control::assert is enabled. When called without a boolean
argument, a boolean value is returned indicating whether the control::assert command is enabled. When called with a valid boolean
value as the boolean argument, the control::assert command is enabled or disabled to match the argument, and an empty string is
returned.
[control::control assert callback ?command?] queries or sets the callback command that will be called by an enabled assert on
assertion failure. When called without a command argument, the current callback command is returned. When called with a command
argument, that argument becomes the new assertion failure callback command. Note that an assertion failure callback command is
always defined, even when assert is disabled. The default callback command is [return -code error].
Note that control::assert has been written so that in combination with [namespace import], it is possible to use enabled assert com-
mands in some namespaces and disabled assert commands in other namespaces at the same time. This capability is useful so that
debugging efforts can be independently controlled module by module.
% package require control
% control::control assert enabled 1
% namespace eval one namespace import ::control::assert
% control::control assert enabled 0
% namespace eval two namespace import ::control::assert
% one::assert {1 == 0}
assertion failed: 1 == 0
% two::assert {1 == 0}
control::do body ?option test?
The do command evaluates the script body repeatedly until the expression test becomes true or as long as (while) test is true,
depending on the value of option being until or while. If option and test are omitted the body is evaluated exactly once. After nor-
mal completion, do returns an empty string. Exceptional return codes (break, continue, error, etc.) during the evaluation of body
are handled in the same way the while command handles them, except as noted in LIMITATIONS, below.
control::no-op ?arg arg ...?
The no-op command takes any number of arguments and does nothing. It returns an empty string.
LIMITATIONS
Several of the commands provided by the control package accept arguments that are scripts to be evaluated. Due to fundamental limitations
of Tcl's catch and return commands, it is not possible for these commands to properly evaluate the command [return -code $code] within one
of those script arguments for any value of $code other than ok. In this way, the commands of the control package are limited as compared
to Tcl's built-in control flow commands (such as if, while, etc.) and those control flow commands that can be provided by packages coded in
C. An example of this difference:
% package require control
% proc a {} {while 1 {return -code error a}}
% proc b {} {control::do {return -code error b} while 1}
% catch a
1
% catch b
0
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category control
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
break, continue, expr, if, join, namespace, return, string, while
KEYWORDS
assert, control, do, flow, no-op, structure
control 0.1.3 control(n)