10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
can I make grep stop after finding the first occurrence of a regex in a line?
Given:
file with various regex patterns
file to be grep'ed
Sadly some of the regex patterns cannot be limited any further, so grep -Eiof patterns.txt file.txt (GNU grep 2.20) will give me possibly n hits... (4 Replies)
Discussion started by: stresing
4 Replies
2. Shell Programming and Scripting
Hello,
one step in a shell script i am writing, involves Grep command to search a regular expression in a line an only print the string after the match
an example line is below
/logs/GRAS/LGT/applogs/lgt-2016-08-24/2016-08-24.8.log.zip:2016-08-24 19:12:48,602 ERROR... (9 Replies)
Discussion started by: Ramneekgupta91
9 Replies
3. Shell Programming and Scripting
Hello.
In my script, some command return :
q | kernel-default | package | 3.19.0-1.1.g8a7d5f9 | x86_64 | openSUSE-13.2-Kernel_stable_standard
| kernel-default | package | 3.19.0-1.1.g8a7d5f9 | i586 | openSUSE-13.2-Kernel_stable_standard
| kernel-default ... (3 Replies)
Discussion started by: jcdole
3 Replies
4. Shell Programming and Scripting
I need to fetch particular string from log file based on grep condition match.
Actual requirement is need to print the next word from the same line based on grep string condtion match.
File :Java.lanag.xyz......File copied completed : abc.txt
Ouput :abc.txt
I have used below... (5 Replies)
Discussion started by: siva83
5 Replies
5. Shell Programming and Scripting
Hi Guru's,
I am trying to grep a range of line numbers (based on match) and then look for another match which starts with a special character '$' and print the line number. I have the below code but it is actually printing the line number counting starting from the first line of the range i am... (15 Replies)
Discussion started by: Kevin Tivoli
15 Replies
6. UNIX for Dummies Questions & Answers
Hello,
Here I have some grep command which is not working correctly:
cat file1.txt:
apples
Date: Sun, 24 Feb 2013 8:14:06 -0800
peaches melons
cherry sky cloud
green purple
yellow
cat file2.txt:
apples
Date
peaches melons 0800
cherry sky cloud
green purple
black (2 Replies)
Discussion started by: holyearth
2 Replies
7. Shell Programming and Scripting
Hi
i have a file which have a pattern like this
Nov 10 session closed
Nov 10 Nov 9 08:14:27 EST5EDT 2010 on tty .
Nov 10 Oct 19 02:14:21 EST5EDT 2010 on pts/tk .
Nov 10 afrtetryytr
Nov 10 session closed
Nov 10 Nov 10 03:21:04 EST5EDT 2010
Dec 8 Nov 10 05:03:02 EST5EDT 2010
... (13 Replies)
Discussion started by: Himanshu_soni
13 Replies
8. UNIX for Dummies Questions & Answers
Hello
I have a silly question. I need to grep a match in text file
and then print 5 lines after it.
grep -A 5 .... do it.
OK
The next thing I can not handle is I need each output to be on 1 line
match line2 line3 line4 line5
match line2 line3 line4 line5
etc..
I will really... (10 Replies)
Discussion started by: alekkz
10 Replies
9. Shell Programming and Scripting
Hello
I need some help with this job.
file.txt
----- cut ----
TARGET
13/11/08
20:43:21
POINT 1
MOVE 8
772102y64312417771
TARGET
13/11/08
21:10:01
POINT 2
MOVE 5
731623jjd12njhd
----- cut ----
this is the example.
i need to grep for the word TARGET and print next 4 lines like... (1 Reply)
Discussion started by: alekkz
1 Replies
10. Shell Programming and Scripting
I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this).
For example, i have a input file1.txt:
cat inputfile1.txt
218299910417
1172051195
1172070231
1172073514
1183135117
1183135118
1183135119
1281440202
... (3 Replies)
Discussion started by: poliver
3 Replies