10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to grep a variable with multiple lines with multiple patterns
below is the pattern list in a variable called "grouplst", each pattern is speerated by "|"
I need to use the patterns above to grep a... (2 Replies)
Discussion started by: ajetangay
2. UNIX for Dummies Questions & Answers
I have a file with the following text:
When I perform these same commands on this file, the result are never what I would expect them to be. Could someone please comment on the results and... (3 Replies)
Discussion started by: uran101
3. Shell Programming and Scripting
I've been trying solve this with a simple command but not having much luck. I have a file like this:
Line 1: random_description 123/alert/high random_description2 356/alert/slow
Line 2: random_description3 654/alert/medium
Line 3: random_description4 234/alert/critical
I'm... (7 Replies)
Discussion started by: joe19
4. Shell Programming and Scripting
I have a file with many rows.
I want to grep for multiple patterns from the file.
I want the lines which has both XX and ZZ.
I know I can get it like this.
grep XX file | grep YY
But... (10 Replies)
Discussion started by: tene
5. Shell Programming and Scripting
i want to match a pattern
for my emails to me that has 'hello' anywhere in the subject. (3 Replies)
Discussion started by: oxoxo
6. Shell Programming and Scripting
I need a simple script to get all lines between 2 Patterns,
114456723: testing Script
114459234: testing Done
It should give all the lines in between 114456723 and 114459234, including these as well.
Any... (2 Replies)
Discussion started by: gurpreet470
7. Shell Programming and Scripting
I have 3 patterns for example to be searched.
These three patterns are available in file1.
The patterns to be searched are in file2.
I want to search the pattern of file1 to file2.
Can any one help with example?
Dhana (1 Reply)
Discussion started by: dhanamurthy
8. Shell Programming and Scripting
I have a file. I need to find multiple patterns in a row and need those rows to divert to new file.
I tried using grep -e / -E / -F options as given in man.
But its not working.
==> cat testgrep.txt
==>... (7 Replies)
Discussion started by: WillImm123
9. Shell Programming and Scripting
Can we grep multiple patterns in UNIX.
cat /x/y/oratab | grep -i "pattern1|pattern2" .... etc
I require the syntax for multiple patterns. | is not working as I explained in example.
Malay (4 Replies)
Discussion started by: malaymaru
10. UNIX for Dummies Questions & Answers
I want to get a list of all the files in the current directory that have two patterns. I can do first grep of one pattern and then with the output do the grep of the second pattern.
if the output of 1st pattern search results in many files, it is very difficult to do a grep of the 2nd pattern for... (1 Reply)
Discussion started by: tselvanin