Give a regular expression that finds two things, try to
come up with regular expressions that find each
individually using "egrep" command?
Answers were Sorted based on User's Feedback
Answer / manikantan t s
egrep -e <expresseion 1> -e <expression 2> <file name>
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / shammi
Suppose yu have file name k.txt
naf@warsteiner:~:>cat k.txt
My name is harish
My name is Mark
Now naf@warsteiner:~:>egrep '(harish|Mark)' k.txt
My name is harish
My name is Mark
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / niranjan
Gud command egrep but it not available in all unix flaviours.
grep -e option do the same as egrep
syntax:-
egrep 'pattern1|pattern2|pattern3' filename
grep -e 'pattern1' -e 'pattern2' -e 'pattern3' filename
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / linuxdemon(vjsujay@gmail.com)
vjsujay@vjsujay-desktop:~/test$ cat jsk
cake
coke
vjsujay@vjsujay-desktop:~/test$ egrep 'c(a|o)ke' jsk
cake
coke
| Is This Answer Correct ? | 1 Yes | 2 No |
Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?
what is virtual machine?
How do I run a whois command?
in UNIX,How to copy file into directory?
What does touch command do in unix?
Is it inbetween or in between?
What does the command ' $who | sort –logfile > newfile' do?
What is the difference between Shell Programming and Shell scripting?
10 Answers HCL, TCS, Wipro,
boot process?
what is shell?
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
Write a command to find all of the files which have been accessed within the last 30 days.
5 Answers Google, IBM, Satyam,