![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AWK: Multiple patterns per line | Plavixo | UNIX for Dummies Questions & Answers | 1 | 05-05-2008 01:31 PM |
| Perl: Match a line with multiple search patterns | Juha | Shell Programming and Scripting | 10 | 04-08-2008 10:43 PM |
| 3 patterns in one line | bashuser | UNIX for Advanced & Expert Users | 1 | 02-16-2008 03:02 PM |
| Searching for data on a specific line numbers | rkumar28 | Shell Programming and Scripting | 8 | 06-17-2005 09:34 PM |
| Append a field to the end of each line of a file based on searching another file. | ultimate | Shell Programming and Scripting | 2 | 03-29-2005 07:21 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
searching for two or more patterns in a line
how can I search for two or more patterns in one line using grep?
for example if I want to show only the lines that have patterns "abc" and "123"? and what if I want to show only the lines that have either "abc" or "123" in them? any hint apprecited |
| Forum Sponsor | ||
|
|
|
|||
|
sed (assigning two or more patterns) ?
hi, how does regular expression for "or" and "and" work in sed?
like if I want sed to find and do something only with the lines that contain "abc" or "123" pattern. or lines that have "abc" and "123" both. I normally use this regular expression for that: ."*{abc,123}.*" but itdoesnt work in sed. can anyone fix this line for me? sed '.*{abc,123}.*/s# etc...' filename |
| Thread Tools | |
| Display Modes | |
|
|