10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a log file that generates multiple logs about a query.
<query time='2016-04-13 13:01:50.825'>
... (3 Replies)
Discussion started by: Junaid Subhani
2. UNIX for Dummies Questions & Answers
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
Discussion started by: demmel
3. Shell Programming and Scripting
Is it possible to display 2 lines after a particular pattern in a shell script. For example in a file which has the below contents.
I want to display 2 lines before and after... (1 Reply)
Discussion started by: balamv
4. UNIX for Dummies Questions & Answers
I have a output file which contains n number of document.Each document has n number of segments and identified using below points
The starting segment is ISA and Ending segment is IEA
Each document has unique number and it will be passed in REF*D9 segment
Each line in sample file is called... (3 Replies)
Discussion started by: nsuresh316
5. UNIX for Dummies Questions & Answers
I would like to know if I can use grep or zgrep to search for a particular pattern then print the x number of lines after the pattern was found.
Lets say for example a pattern was found on line 3, I wanted the output to show lines 3, 4 and 5.
Thanks! (10 Replies)
Discussion started by: khestoi
6. Shell Programming and Scripting
When we have a failure, sometimes we just step restart the job from the next step. Later when we open the log for analysis of the failure, it is becoming difficult to go to the failure part.
For eg., if it is a 1000 line log, the failure may be at 500th line. so wat i want to do is, grep... (6 Replies)
Discussion started by: ajayakunuri
7. Shell Programming and Scripting
I have to grep on a few words in a file and then display the line containing those words and the line above it.
For ex -
abc xyz abc
This is a test
abc xyz abc
Just a test
I find the words 'Test successful' in the file... (6 Replies)
Discussion started by: user7617
8. Shell Programming and Scripting
i have to write a shell script like this----
i have a huge log file name abc.log .i have to search for a pattern name "pattern",it may occur 1000 times in the log file,every time it finds the pattern it should display the 10 lines above the pattern.
I appericiate your help. (30 Replies)
Discussion started by: namishtiwari
is there a way in grep to display few lines before and after the pattern??
I tried options A and B and after-context and before-context. But they don't work on Solaris platform.
please advise. (13 Replies)
Discussion started by: melanie_pfefer
10. UNIX for Dummies Questions & Answers
How do I use grep to find a pattern in a list of file and then display 5 lines after the pattern is matched
I want to match the string GetPresentCode in all files in a folder and then see 4 lines following this match. I am not sure if grep is what should be used to achieve. Thanks!... (3 Replies)
Discussion started by: cv_pan