Hi,
I need to create a script that does the following:
1. Read the file for the occurrences of "EXECUTE" and "END" strings.
There will be several occurrences of EXECUTE and END strings on the file.
2. The resulting lines in #1, needs to be searched for the word... (11 Replies)
I need a simple script to get all lines between 2 Patterns,
e.g.
.............
.............
114456723: testing Script
Alpha
Beta
114459234: testing Done
.............
.............
It should give all the lines in between 114456723 and 114459234, including these as well.
Any... (2 Replies)
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
I want to delete 1 line above the paatern and 3 line below the pattern and the pattern line itself, on the whole 5 lines. If there are three patterns what to do and the final text file to be captured in a new file. (3 Replies)
I need to print out sections (varying numbers of lines) of a file between patterns. That alone is easy enough: sed -n '/START/,/STOP/' I also need the 3 lines BEFORE the start pattern. That alone is easy enough: grep -B3 START But I can't seem to combine the two so that I get everything between the... (2 Replies)
Hi,
I want to print only lines (green-italic lines) in between first and last strings in column 9.
there are different number of lines between each strings.
10 AUGUSTUS exon 4558 4669 . - . 10.g1
10 AUGUSTUS exon 8771 8889 . ... (6 Replies)
I have a list in the format below, how do I read through the list and extract the lines between the ##START## and ##END##, so i can check for specific values between each ##START## & ##END## pattern
##START##
RANDOMTEXT
DFGSD
SDFSDF
##END##
##START##
morestuff
sdfggfg
sdfsdf... (10 Replies)
im using the following code to search a log for entries on two different lines:
awk 'BEGIN{count=0} /'"${firstpattern}"'/,/'"${secondpattern}"'/ { print; if ($0 ~ /'"${thirdpattern}"'/){count++}; } END { print count }' data.txt
firstpattern="start error log"
secondpattern="i am logging the... (1 Reply)
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
LEARN ABOUT DEBIAN
atexit
ATEXIT(3) Linux Programmer's Manual ATEXIT(3)NAME
atexit - register a function to be called at normal process termination
SYNOPSIS
#include <stdlib.h>
int atexit(void (*function)(void));
DESCRIPTION
The atexit() function registers the given function to be called at normal process termination, either via exit(3) or via return from the
program's main(). Functions so registered are called in the reverse order of their registration; no arguments are passed.
The same function may be registered multiple times: it is called once for each registration.
POSIX.1-2001 requires that an implementation allow at least ATEXIT_MAX (32) such functions to be registered. The actual limit supported by
an implementation can be obtained using sysconf(3).
When a child process is created via fork(2), it inherits copies of its parent's registrations. Upon a successful call to one of the
exec(3) functions, all registrations are removed.
RETURN VALUE
The atexit() function returns the value 0 if successful; otherwise it returns a nonzero value.
CONFORMING TO
SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
NOTES
Functions registered using atexit() (and on_exit(3)) are not called if a process terminates abnormally because of the delivery of a signal.
If one of the functions registered functions calls _exit(2), then any remaining functions are not invoked, and the other process termina-
tion steps performed by exit(3) are not performed.
POSIX.1-2001 says that the result of calling exit(3) more than once (i.e., calling exit(3) within a function registered using atexit()) is
undefined. On some systems (but not Linux), this can result in an infinite recursion; portable programs should not invoke exit(3) inside a
function registered using atexit().
The atexit() and on_exit(3) functions register functions on the same list: at normal process termination, the registered functions are
invoked in reverse order of their registration by these two functions.
POSIX.1-2001 says that the result is undefined if longjmp(3) is used to terminate execution of one of the functions registered atexit().
Linux Notes
Since glibc 2.2.3, atexit() (and on_exit(3)) can be used within a shared library to establish functions that are called when the shared
library is unloaded.
EXAMPLE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void
bye(void)
{
printf("That was all, folks
");
}
int
main(void)
{
long a;
int i;
a = sysconf(_SC_ATEXIT_MAX);
printf("ATEXIT_MAX = %ld
", a);
i = atexit(bye);
if (i != 0) {
fprintf(stderr, "cannot set exit function
");
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
SEE ALSO _exit(2), exit(3), on_exit(3)COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-12-05 ATEXIT(3)