Unix HOMEWORK HELP!! Simple Multiple Choice.
I have answered these questions, but I want to ask online, to get
second feedback and make sure I am on the right page
What is the diffference bettween a willd card and a regular expression?
a.) A willd carrd is the * chharacter, butt a rregular excpression caan usse morre symbols.
b.) Wild cards are pattterns expandded by the shhell. A reggular expression is a pattern used by commands, internally.
c.) There is no diffference between wild cards and regular expressions.
2.) Which stattement will sttore into the varriable count the nnumber of .c files that contain the string printf?
a.) count = printf
b.) count = echo grep printf *.c
c.) count = 'grep =1 printf *.c | wc -1'
d.) count = 'grep -c "printf" *.c"
3.) How do you loook for Billl Christie in a file nammed file1 whhen you ddon't know if it is spelled Christie or Christy?
a. grep -E "Bill Christ(ie|y)" file1
b. grep "Bill Christ[iey]" file1
c. grep "Bill Christ[ie or y]" file1
4.) Devvise a seqquence to display a countt of lines containing
sttrings containning <BR /> in all .html ffiles in the
current ddirectory. <BR /> is case-insensitive. It can be
upper or lower case.
a. grep -count "<BR />" *.html
b. grep -i "<BR />" *.html | wc -l
c.grep "<[Bb][Rr] />" *.html
d. none of the above
Answer)
What is the difference between a wild card and a regular expression?
a.) A wild card is the * character, but a regular expression can use more symbols.
The regular expression is a patter to match a text. A wild card is a character which we can use withing a regular expression to match a broadly defined pattern than a specific set of characters.
Unix HOMEWORK HELP!! Simple Multiple Choice. I have answered these questions, but I want to ask...