Shell-script: search item in any order
Hello altogether,
I have got the following problem: - every line in a textfile corresponds to a data record - now i want to search for a certain data record with grep e.g. so far so good. But what, if I want to use several search items (and I don't no their order in the data record) at the same time to serach for a dedicated data record?? Quasi "grep PATTERN1&PATTERN2 /home/file" whereupon it doesn't matter in which order "PATTERN1" and "PATTERN2" occurs in "/home/file". Has anybody an idea?? |
try awk instead.
|
I've got an easy solution interim:
grep PATTERN1 file | grep PATTERN2 Anyway thank you for answering. |
Look at Regular Expressions. Perl supports them internally and it will help you find and/or parse data easily. There should be many tutorials and/or references available online.
good luck |
All times are GMT -5. The time now is 06:59 AM. |