Hi,
Can we grep multiple patterns in UNIX.
for example:
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
Hi,
Can we grep multiple patterns in UNIX.
for example:
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
try !!!!
cat /x/y/oratab | egrep -i "pattern1|pattern2"
Shihab
Depending on your version of grep, this might also work:
cat /x/y/oratab | grep -i -e pattern1 -e pattern2
Why the UUOC ?
Wouldnt this work ?
grep -i -e pattern1 -e pattern2 /x/y/oratab
vino
or ...
egrep -i "str1|str2" /your/file