Apologize for the delay in response. Here are the little bit detailed code snippet where it starts with execution of procedure and check the error and execution status and then transmits the file.where in the proc1, it's checking the condition that if the rejected record is more than 0 then it assigns the value of errcode as 100 and setting user defined message for errmsg. Now i'd like to transmit the file even there is any rejection of records.
i use unix command to take the record count for a file1
awk 'END{print NR}' filename
i already have a file2 which conatin the count like
...
..
rec_cnt=100
..
..
I want to replace the record in the file2 using the record i take from file1.
suggest me some simple ways of doing it... (2 Replies)
Hi
Can someone help me please?
In a standard UNIX .ksh script, if you have the exit status..say 5...what line do you have to enter into the script for this number to be automatically converted to its actual exit reason by looking up the exit status file...wherever that is?
thanks
angus (1 Reply)
Hi all
How to verify the number of records in case of delimited file, If the file has records. And then if it is not equal to mentioned no. of records, email is triggered and file is moved to bad directory path.
Example
-----
input file = a.txt
bad directory path : /usr/bin/bad (6 Replies)
Hi All,
I have a text file with the folowing content.
BANGALORE|1417|2010-02-04 08:41:04.174|dob|xxx
BANGALORE|1416|2010-02-04 08:23:19.566|dob|yyy
BANGALORE|1415|2010-02-04 08:20:14.497|dob|aaa
BANGALORE|1414|2010-02-04 08:19:40.065|dob|vvv
BANGALORE|1413|2010-02-04... (4 Replies)
Hi
Im trying to write a script that will archive some file using java program.Below is the part of the script that I use and my problem is that the script always return with status 0.Below is part of my script(end part)
purge.ksh
echo "No of files before tar :... (4 Replies)
HI,
I need to print the record count of a file using shell script.
If the record count of a file excluding header and trailer record if greater than zero then print 'Record count of a file is xxxx records'.
If the record count is zero print 'zero records'
Thanks
Mahendra (1 Reply)
Hi,
I have files in the directory like below which I need to validate if all the required files are present.
A_B_001 of 002_time1.txt
A_B_002 of 002_time1.txt
A_B_001 of 001_time2.txt
Scenarios-
a)If file with 001 of 002_time1 or 002 of 002_time1 is missing in the folder,script should... (6 Replies)
Hi,
I need a sample script to validate all the database objects like
1. table structure(columns, datatypes,key contraints if any)
2. synonyms
3. grants
4. indexes
....etc
thank you! (2 Replies)
Hi,
I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not...
I have .sh script like below and i have servers.txt contains all the list of servers
#/bin/bash
for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies
LEARN ABOUT DEBIAN
sleepenh
SLEEPENH(1) General Commands Manual SLEEPENH(1)NAME
sleepenh - an enhanced sleep program.
SYNOPSIS
sleepenh [initial-time] sleep-time
DESCRIPTION
sleepenh is a program that can be used when there is a need to execute some functions periodically in a shell script. It was not designed
to be accurate for a single sleep, but to be accurate in a sequence of consecutive sleeps.
After a successful execution, it returns to stdout the timestamp it finished running, that can be used as initial-time to a successive exe-
cution of sleepenh.
OPTIONS
There are no command line options. Run it without any option to get a brief help and version.
ARGUMENTS
sleep-time is a real number in seconds, with microseconds resolution (1 minute, 20 seconds and 123456 microseconds would be 80.123456).
initial-time is a real number in seconds, with microseconds resolution. This number is system dependent. In GNU/Linux systems, it is the
number of seconds since midnight 1970-01-01 GMT. Do not try to get a good value of initial-time. Use the value supplied by a previous exe-
cution of sleepenh.
If you don't specify initial-time, it is assumed the current-time.
EXIT STATUS
An exit status greater or equal to 10 means failure. Known exit status:
0 Success.
1 Success. There was no need to sleep. (means that initial-time + sleep-time was greater than current-time).
10 Failure. Missing command line arguments.
11 Failure. Did not receive SIGALRM.
12 Failure. Argument is not a number.
13 Failure. System error, could not get current time.
USAGE EXAMPLE
Suppose you need to send the char 'A' to the serial port ttyS0 every 4 seconds. This will do that:
#!/bin/sh
TIMESTAMP=`sleepenh 0`
while true; do
# send the byte to ttyS0
echo -n "A" > /dev/ttyS0;
# just print a nice message on screen
echo -n "I sent 'A' to ttyS0, time now is ";
sleepenh 0;
# wait the required time
TIMESTAMP=`sleepenh $TIMESTAMP 4.0`;
done
HINT
This program can be used to get the current time. Just execute:
sleepenh 0
BUGS
It is not accurate for a single sleep. Short sleep-times will also not be accurate.
SEE ALSO date(1), sleep(1).
AUTHOR
This manual page was written by Pedro Zorzenon Neto.
2008/04/20 SLEEPENH(1)