Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Grep command on multiple line Post 303026308 by Scrutinizer on Saturday 24th of November 2018 02:40:42 AM
Old 11-24-2018
Hi, try something like:
Code:
find ./packages -type f -name flow.xml -exec awk '/^<MAP .*<\/COMMENT>.*<\/MAP>$/{print FILENAME}' RS= {} +





--
or if there can be empty lines in the file, use a dummy record separator to force awk to read the file at once and test for a newline at the end..
Code:
find . -type f -name 'infile6584*' -exec awk '/^<MAP .*<\/COMMENT>.*<\/MAP>\n$/{print FILENAME}' RS='§' {} +


Last edited by Scrutinizer; 11-24-2018 at 07:52 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiple Line search using grep

Hi All, I am trying to search multiple lines in file using grep /sed.And i cant seem to make it work. The File looks like this 5012001,100,AUTOBATCH,FEE,DAILYFEE,0,0 4241 SERVICE DENIED 5012002,100,AUTOBATCH,FEE,DAILYFEE,0,0 4241 SERVICE DENIED... (6 Replies)
Discussion started by: pistachio
6 Replies

2. Solaris

Multiple pattern on same line using grep

Hi, I would like to search multiple patterns on same line, i.e. all patterns must present on same line. Please suggest. Thanx (2 Replies)
Discussion started by: sanjay1979
2 Replies

3. Shell Programming and Scripting

grep multiple words in a single line

Hi.. How to search for multiple words in a single line using grep?. Eg: Jack and Jill went up the hill Jack and Jill were best friends Humpty and Dumpty were good friends too ---------- I want to extract the 2nd statement(assuming there are several statements with... (11 Replies)
Discussion started by: anduzzi
11 Replies

4. UNIX for Advanced & Expert Users

grep for a line in a file on multiple unix servers

Hi, I need to grep(look) for a line in filename named /tmp/Test on all 90 unix servers. Without logging to each servers manually and grep'ing for the line, is there a way to pull this info in output file thru' the ksh/sh/bash script. Can someone pl. help to create this script for me? Ex.... (3 Replies)
Discussion started by: Mike1234
3 Replies

5. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

6. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

7. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

8. Shell Programming and Scripting

Multiple Results of Grep in one Line/String?

Hello, I have a Textfile sees like this "Word1":aksdfjaksdf "Word2":askdfjalsdkfdlsjfasldfj "This is Word3":asdfkjalskdfj what i need is a string which sees like this Word1;Word2;This is Word3 Conclusion always the text within "" which is before the : i tried it with grep.... (10 Replies)
Discussion started by: SwordMaster
10 Replies

9. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

I am looking for help in processing of those options: '-n' or '-p' I understand what they do and how to use them. But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.) I did try it and -n works on 2 files. Question is: - is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies

10. UNIX for Beginners Questions & Answers

Grep multiple patterns(file) and replace whole line

I am able to grep multiple patterns which stored in a files. However, how could we replace the whole line with either the pattern or new string? For example: pattern_file: *Info in the () is not part of the pattern file. They are the intended name to replace the whole line after the pattern... (5 Replies)
Discussion started by: wxboo
5 Replies
REPORT-GTK(1)							 LIBREPORT MANUAL						     REPORT-GTK(1)

NAME
report-gtk - GUI tool to analyze and report ABRT problems SYNOPSIS
report-gtk [-vpdx] [-e EVENT] [-g GUI_FILE] PROBLEM_DIR DESCRIPTION
report-gtk is a graphical tool that reports application crashes and other problems caught by abrtd daemon, or created by other programs using libreport. report-gtk works with a single problem saved in specified PROBLEM_DIR. In the expert mode it enables access to and manipulation of problem data. OPTIONS
-d, --delete Remove PROBLEM_DIR after reporting -e EVENT Run only theset EVENTs on PROBLEM_DIR -g FILE Alternate GUI file -p Add program names to log -v, --verbose Be verbose -V, --version Display version and exit -x, --expert Enabled advanced features CONFIGURATION
Reporting work flow configuration These configuration files are placed in /usr/share/libreport/workflows. Each file has XML formatting with the following DTD: <!ELEMENT workflow (name+,description+,events*)> <!ELEMENT name (#PCDATA)> <!ATTLIST name xml:lang CDATA #IMPLIED> <!ELEMENT description (#PCDATA)> <!ATTLIST description xml:lang CDATA #IMPLIED> <!ELEMENT events = (event)+> <!ELEMENT event = (#PCDATA)> name User visible name description User visible description events List of executed events event Name of event. If event is not applicable on the problem data or if it is not defined then process continues with next event sibling. EXAMPLES
Simple reporting work flow <workflow> <name xml:lang="en">Example</name> <name xml:lang="cs">Piklad</name> <description xml:lang="en">Example description</description> <description xml:lang="cs">Piklad popisu</description> <evetns> <event>analyze_example</event> <event>collect_example</event> <event>report_example</event> </events> </workflow> AUTHORS
o ABRT team LIBREPORT 2.1.11 06/18/2014 REPORT-GTK(1)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy