Ask Question
3 July, 14:32

Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?

a. grep 'b[au]nk$' myLine

b. grep "b[au]nk$" myLine

c. grep b[au]nk$ myLine

d. grep 'b[au]nk$" myLine

+1
Answers (1)
  1. 3 July, 14:45
    0
    a. grep 'b[au]nk$' myLine

    Explanation:

    grep is a command used for searching a specified pattern in a given text.

    Our goal is to match the character sequence - bank or bunk at the end of line in a given line referenced by myLine.

    The regular expression for the specified match criterion is:

    b[au]nk$

    The second character can be either a or u.

    $ indicates match at end of line.

    So the overall grep command is:

    grep 'b[au]nk$' myLine
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text? a. grep 'b[au]nk$' ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers