nerdexam
LPI

101-500 · Question #154

You have created a long letter and after you are done you notice that you used the name "Bob" many times but you forgot to capitalize it in many instances. Which command would replace "bob" with…

The correct answer is D. sed 's/bob/Bob/g' letter > newletter. You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

GNU and Unix Commands

Question

You have created a long letter and after you are done you notice that you used the name "Bob" many times but you forgot to capitalize it in many instances. Which command would replace "bob" with "Bob" in all instances and generate a new letter for printing?

Options

  • Ased '/bob/Bob' letter > newletter
  • Bsed s/bob/Bob/ letter < newletter
  • Csed 's/bob/Bob' letter > newletter
  • Dsed 's/bob/Bob/g' letter > newletter
  • Esed 's/bob, Bob/' letter > newletter

How the community answered

(44 responses)
  • A
    2% (1)
  • B
    7% (3)
  • C
    2% (1)
  • D
    77% (34)
  • E
    11% (5)

Explanation

You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

Topics

#sed#pattern matching#text substitution#stream processing

Community Discussion

No community discussion yet for this question.

Full 101-500 Practice