Ask Question
28 April, 01:26

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

+2
Answers (1)
  1. 28 April, 04:00
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers