Sponsored Content
Top Forums Shell Programming and Scripting Getting the lines between last occurrence of two patterns Post 302167338 by rvz on Thursday 14th of February 2008 06:28:09 AM
Old 02-14-2008
Quote:
Originally Posted by maverix
good that you found it useful!!!

check out the man pages for tail, awk and grep to understand how it works.
In particular, check the switches I've used for each command.

Don't think I am being rude to you.
You must have heard the good old story where the fisherman taught a starving person to fish, rather than giving him few of his catch :-)

cheers
maverix
I understood your usage of command.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get lines in between Patterns?

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)
Discussion started by: racbern
11 Replies

2. Shell Programming and Scripting

Searching patterns in 1 file and deleting all lines with those patterns in 2nd file

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)
Discussion started by: toms
4 Replies

3. Shell Programming and Scripting

How can I get the lines between two patterns?

hi, I have the following file hello world this is to say bye to everyone so bye I want to get the lines from hello to the first bye inclusive into another file? how can I do this (11 Replies)
Discussion started by: JamesByars
11 Replies

4. Shell Programming and Scripting

Extracting text between two patterns 1 and 2 and pattern2 should be second occurrence of the file

Hi All, I have a small query. I have a file containing the following lines File 1: 29-Jul-2011 GMT Static data requires update <Extraction should start here> ----------- ----------- -------------------- ----------------------- ----------- <should stop here> Pattern1 will be time... (2 Replies)
Discussion started by: gangii87
2 Replies

5. Shell Programming and Scripting

Sed/awk print between different patterns the first occurrence

Thanks for the help yesterday. I have a little modification today, I am trying the following: i have a log file of a webbap which logs in the following pattern: 2011-08-14 21:10:04,535 blablabla ERROR Exception1 blablabla bla bla bla bla 2011-08-14... (2 Replies)
Discussion started by: ppolianidis
2 Replies

6. Shell Programming and Scripting

[Solved] Sed/awk print between patterns the first occurrence

Guys, I am trying the following: i have a log file of a webbap which logs in the following pattern: 2011-08-14 21:10:04,535 blablabla ERROR blablabla bla bla bla bla 2011-08-14 21:10:04,535 blablabla ERROR blablabla bla bla bla ... (6 Replies)
Discussion started by: ppolianidis
6 Replies

7. Shell Programming and Scripting

How to output all lines following Nth occurrence of string

Greetings experts. Searched the forums (perhaps not hard enough?) - Am searching for a method to capture all output from a log file following the nth occurrence of a known string. Background: Using bash, I want to monitor my Oracle DB alert log file. The script will count the total # of... (2 Replies)
Discussion started by: cjtravis
2 Replies

8. Shell Programming and Scripting

UNIX help to print 50 lines after every 3rd occurrence pattern till end of file

I need help with extract/print lines till stop pattern. This needs to happen after every 3rd occurrence of start pattern and continue till end of file. Consider below is an example of the log file. my start pattern will be every 3rd occurrence of ERROR_FILE_NOT_FOUND and stop pattern will be... (5 Replies)
Discussion started by: NSS
5 Replies

9. UNIX for Beginners Questions & Answers

Delete multiple lines between blank lines containing two patterns

Hi all, I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex: user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies

10. UNIX for Beginners Questions & Answers

How to print lines from a files with specific start and end patterns and pick only the last lines?

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
DPKG-DEPCHECK(1)						      DEBIAN							  DPKG-DEPCHECK(1)

NAME
dpkg-depcheck - determine packages used to execute a command SYNOPSIS
dpkg-depcheck [options] command DESCRIPTION
This program runs the specified command under strace and then determines and outputs the packages used in the process. The list can be trimmed in various ways as described in the options below. A good example of this program would be the command dpkg-depcheck -b debian/rules build, which would give a good first approximation to the Build-Depends line needed by a Debian package. Note, however, that this does not give any direct information on versions required or architecture-specific packages. OPTIONS
-a, --all Report all packages used to run command. This is the default behaviour. If used in conjunction with -b, -d or -m, gives additional information on those packages skipped by these options. -b, --build-depends Do not report any build-essential or essential packages used, or any of their (direct or indirect) dependencies. -d, --ignore-dev-deps Do not show packages used which are direct dependencies of -dev packages used. This implies -b. -m, --min-deps Output a minimal set of packages needed, taking into account direct dependencies. Using -m implies -d and also -b. -C, --C-locale Run command with the C locale. --no-C-locale Don't change locale when running command. -l, --list-files Also report the list of files used in each package. --no-list-files Do not report the files used in each package. Cancels a -l option. -o, --output=FILE Output the package diagnostics to FILE instead of stdout. -O, --strace-output=FILE Write the strace output to FILE when tracing command instead of using a temporary file. -I, --strace-input=FILE Get strace output from FILE instead of tracing command; strace must have be run with the -f -q options for this to work. -f, --features=LIST Enable or disabled features given in the comma-separated LIST as follows. A feature is enabled with +feature or just feature and disabled with -feature. The currently recognised features are: warn-local Warn if files in /usr/local or /var/local are used. Enabled by default. discard-check-version Discards execve when only a --version argument is given to the program; this works around some configure scripts that check for binaries they don't actually use. Enabled by default. trace-local Also try to identify files which are accessed in /usr/local and /var/local. Not usually very useful, as Debian does not place files in these directories. Disabled by default. catch-alternatives Warn about access to files controlled by the Debian alternatives mechanism. Enabled by default. discard-sgml-catalogs Discards access to SGML catalogs; some SGML tools read all the registered catalogs at startup. Files matching the regexp /usr/share/sgml/.*.cat are recognised as catalogs. Enabled by default. --no-conf, --noconf Do not read any configuration files. This can only be used as the first option given on the command-line. -h, --help Display usage information and exit. -v, --version Display version and copyright information and exit. CONFIGURATION VARIABLES
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced in that order to set configuration variables. Command line options can be used to override configuration file settings. Environment variable settings are ignored for this purpose. The currently recognised variable is: DPKG_DEPCHECK_OPTIONS These are options which are parsed before the command-line options. For example, DPKG_DEPCHECK_OPTIONS="-b -f-catch-alternatives" which passes these options to dpkg-depcheck before any command-line options are processed. You are advised not to try tricky quot- ing, because of the vagaries of shell quoting! SEE ALSO
dpkg(1), strace(1), update-alternatives(8) and devscripts.conf(5). COPYING
Copyright 2001 Bill Allombert <ballombe@debian.org>. Modifications copyright 2002,2003 Julian Gilbey <jdg@debian.org>. dpkg-depcheck is free software, covered by the GNU General Public License, version 2 or (at your option) any later version, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for dpkg-depcheck. dpkg-depcheck March 2002 DPKG-DEPCHECK(1)
All times are GMT -4. The time now is 01:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy